text:
// Code generated by protoc-gen-go.
// source: google.golang.org/appengine/internal/image/images_service.proto
// DO NOT EDIT!

/*
Package image is a generated protocol buffer package.

It is generated from these files:
	google.golang.org/appengine/internal/image/images_service.proto

It has these top-level messages:
	ImagesServiceError
	ImagesServiceTransform
	Transform
	ImageData
	InputSettings
	OutputSettings
	ImagesTransformRequest
	ImagesTransformResponse
	CompositeImageOptions
	ImagesCanvas
	ImagesCompositeRequest
	ImagesCompositeResponse
	ImagesHistogramRequest
	ImagesHistogram
	ImagesHistogramResponse
	ImagesGetUrlBaseRequest
	ImagesGetUrlBaseResponse
	ImagesDeleteUrlBaseRequest
	ImagesDeleteUrlBaseResponse
*/
package image

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

type ImagesServiceError_ErrorCode int32

const (
	ImagesServiceError_UNSPECIFIED_ERROR  ImagesServiceError_ErrorCode = 1
	ImagesServiceError_BAD_TRANSFORM_DATA ImagesServiceError_ErrorCode = 2
	ImagesServiceError_NOT_IMAGE          ImagesServiceError_ErrorCode = 3
	ImagesServiceError_BAD_IMAGE_DATA     ImagesServiceError_ErrorCode = 4
	ImagesServiceError_IMAGE_TOO_LARGE    ImagesServiceError_ErrorCode = 5
	ImagesServiceError_INVALID_BLOB_KEY   ImagesServiceError_ErrorCode = 6
	ImagesServiceError_ACCESS_DENIED      ImagesServiceError_ErrorCode = 7
	ImagesServiceError_OBJECT_NOT_FOUND   ImagesServiceError_ErrorCode = 8
)

var ImagesServiceError_ErrorCode_name = map[int32]string{
	1: "UNSPECIFIED_ERROR",
	2: "BAD_TRANSFORM_DATA",
	3: "NOT_IMAGE",
	4: "BAD_IMAGE_DATA",
	5: "IMAGE_TOO_LARGE",
	6: "INVALID_BLOB_KEY",
	7: "ACCESS_DENIED",
	8: "OBJECT_NOT_FOUND",
}
var ImagesServiceError_ErrorCode_value = map[string]int32{
	"UNSPECIFIED_ERROR":  1,
	"BAD_TRANSFORM_DATA": 2,
	"NOT_IMAGE":          3,
	"BAD_IMAGE_DATA":     4,
	"IMAGE_TOO_LARGE":    5,
	"INVALID_BLOB_KEY":   6,
	"ACCESS_DENIED":      7,
	"OBJECT_NOT_FOUND":   8,
}

func (x ImagesServiceError_ErrorCode) Enum() *ImagesServiceError_ErrorCode {
	p := new(ImagesServiceError_ErrorCode)
	*p = x
	return p
}
func (x ImagesServiceError_ErrorCode) String() string {
	return proto.EnumName(ImagesServiceError_ErrorCode_name, int32(x))
}
func (x *ImagesServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(ImagesServiceError_ErrorCode_value, data, "ImagesServiceError_ErrorCode")
	if err != nil {
		return err
	}
	*x = ImagesServiceError_ErrorCode(value)
	return nil
}

type ImagesServiceTransform_Type int32

const (
	ImagesServiceTransform_RESIZE           ImagesServiceTransform_Type = 1
	ImagesServiceTransform_ROTATE           ImagesServiceTransform_Type = 2
	ImagesServiceTransform_HORIZONTAL_FLIP  ImagesServiceTransform_Type = 3
	ImagesServiceTransform_VERTICAL_FLIP    ImagesServiceTransform_Type = 4
	ImagesServiceTransform_CROP             ImagesServiceTransform_Type = 5
	ImagesServiceTransform_IM_FEELING_LUCKY ImagesServiceTransform_Type = 6
)

var ImagesServiceTransform_Type_name = map[int32]string{
	1: "RESIZE",
	2: "ROTATE",
	3: "HORIZONTAL_FLIP",
	4: "VERTICAL_FLIP",
	5: "CROP",
	6: "IM_FEELING_LUCKY",
}
var ImagesServiceTransform_Type_value = map[string]int32{
	"RESIZE":           1,
	"ROTATE":           2,
	"HORIZONTAL_FLIP":  3,
	"VERTICAL_FLIP":    4,
	"CROP":             5,
	"IM_FEELING_LUCKY": 6,
}

func (x ImagesServiceTransform_Type) Enum() *ImagesServiceTransform_Type {
	p := new(ImagesServiceTransform_Type)
	*p = x
	return p
}
func (x ImagesServiceTransform_Type) String() string {
	return proto.EnumName(ImagesServiceTransform_Type_name, int32(x))
}
func (x *ImagesServiceTransform_Type) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(ImagesServiceTransform_Type_value, data, "ImagesServiceTransform_Type")
	if err != nil {
		return err
	}
	*x = ImagesServiceTransform_Type(value)
	return nil
}

type InputSettings_ORIENTATION_CORRECTION_TYPE int32

const (
	InputSettings_UNCHANGED_ORIENTATION InputSettings_ORIENTATION_CORRECTION_TYPE = 0
	InputSettings_CORRECT_ORIENTATION   InputSettings_ORIENTATION_CORRECTION_TYPE = 1
)

var InputSettings_ORIENTATION_CORRECTION_TYPE_name = map[int32]string{
	0: "UNCHANGED_ORIENTATION",
	1: "CORRECT_ORIENTATION",
}
var InputSettings_ORIENTATION_CORRECTION_TYPE_value = map[string]int32{
	"UNCHANGED_ORIENTATION": 0,
	"CORRECT_ORIENTATION":   1,
}

func (x InputSettings_ORIENTATION_CORRECTION_TYPE) Enum() *InputSettings_ORIENTATION_CORRECTION_TYPE {
	p := new(InputSettings_ORIENTATION_CORRECTION_TYPE)
	*p = x
	return p
}
func (x InputSettings_ORIENTATION_CORRECTION_TYPE) String() string {
	return proto.EnumName(InputSettings_ORIENTATION_CORRECTION_TYPE_name, int32(x))
}
func (x *InputSettings_ORIENTATION_CORRECTION_TYPE) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(InputSettings_ORIENTATION_CORRECTION_TYPE_value, data, "InputSettings_ORIENTATION_CORRECTION_TYPE")
	if err != nil {
		return err
	}
	*x = InputSettings_ORIENTATION_CORRECTION_TYPE(value)
	return nil
}

type OutputSettings_MIME_TYPE int32

const (
	OutputSettings_PNG  OutputSettings_MIME_TYPE = 0
	OutputSettings_JPEG OutputSettings_MIME_TYPE = 1
	OutputSettings_WEBP OutputSettings_MIME_TYPE = 2
)

var OutputSettings_MIME_TYPE_name = map[int32]string{
	0: "PNG",
	1: "JPEG",
	2: "WEBP",
}
var OutputSettings_MIME_TYPE_value = map[string]int32{
	"PNG":  0,
	"JPEG": 1,
	"WEBP": 2,
}

func (x OutputSettings_MIME_TYPE) Enum() *OutputSettings_MIME_TYPE {
	p := new(OutputSettings_MIME_TYPE)
	*p = x
	return p
}
func (x OutputSettings_MIME_TYPE) String() string {
	return proto.EnumName(OutputSettings_MIME_TYPE_name, int32(x))
}
func (x *OutputSettings_MIME_TYPE) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(OutputSettings_MIME_TYPE_value, data, "OutputSettings_MIME_TYPE")
	if err != nil {
		return err
	}
	*x = OutputSettings_MIME_TYPE(value)
	return nil
}

type CompositeImageOptions_ANCHOR int32

const (
	CompositeImageOptions_TOP_LEFT     CompositeImageOptions_ANCHOR = 0
	CompositeImageOptions_TOP          CompositeImageOptions_ANCHOR = 1
	CompositeImageOptions_TOP_RIGHT    CompositeImageOptions_ANCHOR = 2
	CompositeImageOptions_LEFT         CompositeImageOptions_ANCHOR = 3
	CompositeImageOptions_CENTER       CompositeImageOptions_ANCHOR = 4
	CompositeImageOptions_RIGHT        CompositeImageOptions_ANCHOR = 5
	CompositeImageOptions_BOTTOM_LEFT  CompositeImageOptions_ANCHOR = 6
	CompositeImageOptions_BOTTOM       CompositeImageOptions_ANCHOR = 7
	CompositeImageOptions_BOTTOM_RIGHT CompositeImageOptions_ANCHOR = 8
)

var CompositeImageOptions_ANCHOR_name = map[int32]string{
	0: "TOP_LEFT",
	1: "TOP",
	2: "TOP_RIGHT",
	3: "LEFT",
	4: "CENTER",
	5: "RIGHT",
	6: "BOTTOM_LEFT",
	7: "BOTTOM",
	8: "BOTTOM_RIGHT",
}
var CompositeImageOptions_ANCHOR_value = map[string]int32{
	"TOP_LEFT":     0,
	"TOP":          1,
	"TOP_RIGHT":    2,
	"LEFT":         3,
	"CENTER":       4,
	"RIGHT":        5,
	"BOTTOM_LEFT":  6,
	"BOTTOM":       7,
	"BOTTOM_RIGHT": 8,
}

func (x CompositeImageOptions_ANCHOR) Enum() *CompositeImageOptions_ANCHOR {
	p := new(CompositeImageOptions_ANCHOR)
	*p = x
	return p
}
func (x CompositeImageOptions_ANCHOR) String() string {
	return proto.EnumName(CompositeImageOptions_ANCHOR_name, int32(x))
}
func (x *CompositeImageOptions_ANCHOR) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(CompositeImageOptions_ANCHOR_value, data, "CompositeImageOptions_ANCHOR")
	if err != nil {
		return err
	}
	*x = CompositeImageOptions_ANCHOR(value)
	return nil
}

type ImagesServiceError struct {
	XXX_unrecognized []byte `json:"-"`
}

func (m *ImagesServiceError) Reset()         { *m = ImagesServiceError{} }
func (m *ImagesServiceError) String() string { return proto.CompactTextString(m) }
func (*ImagesServiceError) ProtoMessage()    {}

type ImagesServiceTransform struct {
	XXX_unrecognized []byte `json:"-"`
}

func (m *ImagesServiceTransform) Reset()         { *m = ImagesServiceTransform{} }
func (m *ImagesServiceTransform) String() string { return proto.CompactTextString(m) }
func (*ImagesServiceTransform) ProtoMessage()    {}

type Transform struct {
	Width            *int32   `protobuf:"varint,1,opt,name=width" json:"width,omitempty"`
	Height           *int32   `protobuf:"varint,2,opt,name=height" json:"height,omitempty"`
	CropToFit        *bool    `protobuf:"varint,11,opt,name=crop_to_fit,def=0" json:"crop_to_fit,omitempty"`
	CropOffsetX      *float32 `protobuf:"fixed32,12,opt,name=crop_offset_x,def=0.5" json:"crop_offset_x,omitempty"`
	CropOffsetY      *float32 `protobuf:"fixed32,13,opt,name=crop_offset_y,def=0.5" json:"crop_offset_y,omitempty"`
	Rotate           *int32   `protobuf:"varint,3,opt,name=rotate,def=0" json:"rotate,omitempty"`
	HorizontalFlip   *bool    `protobuf:"varint,4,opt,name=horizontal_flip,def=0" json:"horizontal_flip,omitempty"`
	VerticalFlip     *bool    `protobuf:"varint,5,opt,name=vertical_flip,def=0" json:"vertical_flip,omitempty"`
	CropLeftX        *float32 `protobuf:"fixed32,6,opt,name=crop_left_x,def=0" json:"crop_left_x,omitempty"`
	CropTopY         *float32 `protobuf:"fixed32,7,opt,name=crop_top_y,def=0" json:"crop_top_y,omitempty"`
	CropRightX       *float32 `protobuf:"fixed32,8,opt,name=crop_right_x,def=1" json:"crop_right_x,omitempty"`
	CropBottomY      *float32 `protobuf:"fixed32,9,opt,name=crop_bottom_y,def=1" json:"crop_bottom_y,omitempty"`
	Autolevels       *bool    `protobuf:"varint,10,opt,name=autolevels,def=0" json:"autolevels,omitempty"`
	AllowStretch     *bool    `protobuf:"varint,14,opt,name=allow_stretch,def=0" json:"allow_stretch,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (m *Transform) Reset()         { *m = Transform{} }
func (m *Transform) String() string { return proto.CompactTextString(m) }
func (*Transform) ProtoMessage()    {}

const Default_Transform_CropToFit bool = false
const Default_Transform_CropOffsetX float32 = 0.5
const Default_Transform_CropOffsetY float32 = 0.5
const Default_Transform_Rotate int32 = 0
const Default_Transform_HorizontalFlip bool = false
const Default_Transform_VerticalFlip bool = false
const Default_Transform_CropLeftX float32 = 0
const Default_Transform_CropTopY float32 = 0
const Default_Transform_CropRightX float32 = 1
const Default_Transform_CropBottomY float32 = 1
const Default_Transform_Autolevels bool = false
const Default_Transform_AllowStretch bool = false

func (m *Transform) GetWidth() int32 {
	if m != nil && m.Width != nil {
		return *m.Width
	}
	return 0
}

func (m *Transform) GetHeight() int32 {
	if m != nil && m.Height != nil {
		return *m.Height
	}
	return 0
}

func (m *Transform) GetCropToFit() bool {
	if m != nil && m.CropToFit != nil {
		return *m.CropToFit
	}
	return Default_Transform_CropToFit
}

func (m *Transform) GetCropOffsetX() float32 {
	if m != nil && m.CropOffsetX != nil {
		return *m.CropOffsetX
	}
	return Default_Transform_CropOffsetX
}

func (m *Transform) GetCropOffsetY() float32 {
	if m != nil && m.CropOffsetY != nil {
		return *m.CropOffsetY
	}
	return Default_Transform_CropOffsetY
}

func (m *Transform) GetRotate() int32 {
	if m != nil && m.Rotate != nil {
		return *m.Rotate
	}
	return Default_Transform_Rotate
}

func (m *Transform) GetHorizontalFlip() bool {
	if m != nil && m.HorizontalFlip != nil {
		return *m.HorizontalFlip
	}
	return Default_Transform_HorizontalFlip
}

func (m *Transform) GetVerticalFlip() bool {
	if m != nil && m.VerticalFlip != nil {
		return *m.VerticalFlip
	}
	return Default_Transform_VerticalFlip
}

func (m *Transform) GetCropLeftX() float32 {
	if m != nil && m.CropLeftX != nil {
		return *m.CropLeftX
	}
	return Default_Transform_CropLeftX
}

func (m *Transform) GetCropTopY() float32 {
	if m != nil && m.CropTopY != nil {
		return *m.CropTopY
	}
	return Default_Transform_CropTopY
}

func (m *Transform) GetCropRightX() float32 {
	if m != nil && m.CropRightX != nil {
		return *m.CropRightX
	}
	return Default_Transform_CropRightX
}

func (m *Transform) GetCropBottomY() float32 {
	if m != nil && m.CropBottomY != nil {
		return *m.CropBottomY
	}
	return Default_Transform_CropBottomY
}

func (m *Transform) GetAutolevels() bool {
	if m != nil && m.Autolevels != nil {
		return *m.Autolevels
	}
	return Default_Transform_Autolevels
}

func (m *Transform) GetAllowStretch() bool {
	if m != nil && m.AllowStretch != nil {
		return *m.AllowStretch
	}
	return Default_Transform_AllowStretch
}

type ImageData struct {
	Content          []byte  `protobuf:"bytes,1,req,name=content" json:"content,omitempty"`
	BlobKey          *string `protobuf:"bytes,2,opt,name=blob_key" json:"blob_key,omitempty"`
	Width            *int32  `protobuf:"varint,3,opt,name=width" json:"width,omitempty"`
	Height           *int32  `protobuf:"varint,4,opt,name=height" json:"height,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *ImageData) Reset()         { *m = ImageData{} }
func (m *ImageData) String() string { return proto.CompactTextString(m) }
func (*ImageData) ProtoMessage()    {}

func (m *ImageData) GetContent() []byte {
	if m != nil {
		return m.Content
	}
	return nil
}

func (m *ImageData) GetBlobKey() string {
	if m != nil && m.BlobKey != nil {
		return *m.BlobKey
	}
	return ""
}

func (m *ImageData) GetWidth() int32 {
	if m != nil && m.Width != nil {
		return *m.Width
	}
	return 0
}

func (m *ImageData) GetHeight() int32 {
	if m != nil && m.Height != nil {
		return *m.Height
	}
	return 0
}

type InputSettings struct {
	CorrectExifOrientation     *InputSettings_ORIENTATION_CORRECTION_TYPE `protobuf:"varint,1,opt,name=correct_exif_orientation,enum=appengine.InputSettings_ORIENTATION_CORRECTION_TYPE,def=0" json:"correct_exif_orientation,omitempty"`
	ParseMetadata              *bool                                      `protobuf:"varint,2,opt,name=parse_metadata,def=0" json:"parse_metadata,omitempty"`
	TransparentSubstitutionRgb *int32                                     `protobuf:"varint,3,opt,name=transparent_substitution_rgb" json:"transparent_substitution_rgb,omitempty"`
	XXX_unrecognized           []byte                                     `json:"-"`
}

func (m *InputSettings) Reset()         { *m = InputSettings{} }
func (m *InputSettings) String() string { return proto.CompactTextString(m) }
func (*InputSettings) ProtoMessage()    {}

const Default_InputSettings_CorrectExifOrientation InputSettings_ORIENTATION_CORRECTION_TYPE = InputSettings_UNCHANGED_ORIENTATION
const Default_InputSettings_ParseMetadata bool = false

func (m *InputSettings) GetCorrectExifOrientation() InputSettings_ORIENTATION_CORRECTION_TYPE {
	if m != nil && m.CorrectExifOrientation != nil {
		return *m.CorrectExifOrientation
	}
	return Default_InputSettings_CorrectExifOrientation
}

func (m *InputSettings) GetParseMetadata() bool {
	if m != nil && m.ParseMetadata != nil {
		return *m.ParseMetadata
	}
	return Default_InputSettings_ParseMetadata
}

func (m *InputSettings) GetTransparentSubstitutionRgb() int32 {
	if m != nil && m.TransparentSubstitutionRgb != nil {
		return *m.TransparentSubstitutionRgb
	}
	return 0
}

type OutputSettings struct {
	MimeType         *OutputSettings_MIME_TYPE `protobuf:"varint,1,opt,name=mime_type,enum=appengine.OutputSettings_MIME_TYPE,def=0" json:"mime_type,omitempty"`
	Quality          *int32                    `protobuf:"varint,2,opt,name=quality" json:"quality,omitempty"`
	XXX_unrecognized []byte                    `json:"-"`
}

func (m *OutputSettings) Reset()         { *m = OutputSettings{} }
func (m *OutputSettings) String() string { return proto.CompactTextString(m) }
func (*OutputSettings) ProtoMessage()    {}

const Default_OutputSettings_MimeType OutputSettings_MIME_TYPE = OutputSettings_PNG

func (m *OutputSettings) GetMimeType() OutputSettings_MIME_TYPE {
	if m != nil && m.MimeType != nil {
		return *m.MimeType
	}
	return Default_OutputSettings_MimeType
}

func (m *OutputSettings) GetQuality() int32 {
	if m != nil && m.Quality != nil {
		return *m.Quality
	}
	return 0
}

type ImagesTransformRequest struct {
	Image            *ImageData      `protobuf:"bytes,1,req,name=image" json:"image,omitempty"`
	Transform        []*Transform    `protobuf:"bytes,2,rep,name=transform" json:"transform,omitempty"`
	Output           *OutputSettings `protobuf:"bytes,3,req,name=output" json:"output,omitempty"`
	Input            *InputSettings  `protobuf:"bytes,4,opt,name=input" json:"input,omitempty"`
	XXX_unrecognized []byte          `json:"-"`
}

func (m *ImagesTransformRequest) Reset()         { *m = ImagesTransformRequest{} }
func (m *ImagesTransformRequest) String() string { return proto.CompactTextString(m) }
func (*ImagesTransformRequest) ProtoMessage()    {}

func (m *ImagesTransformRequest) GetImage() *ImageData {
	if m != nil {
		return m.Image
	}
	return nil
}

func (m *ImagesTransformRequest) GetTransform() []*Transform {
	if m != nil {
		return m.Transform
	}
	return nil
}

func (m *ImagesTransformRequest) GetOutput() *OutputSettings {
	if m != nil {
		return m.Output
	}
	return nil
}

func (m *ImagesTransformRequest) GetInput() *InputSettings {
	if m != nil {
		return m.Input
	}
	return nil
}

type ImagesTransformResponse struct {
	Image            *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"`
	SourceMetadata   *string    `protobuf:"bytes,2,opt,name=source_metadata" json:"source_metadata,omitempty"`
	XXX_unrecognized []byte     `json:"-"`
}

func (m *ImagesTransformResponse) Reset()         { *m = ImagesTransformResponse{} }
func (m *ImagesTransformResponse) String() string { return proto.CompactTextString(m) }
func (*ImagesTransformResponse) ProtoMessage()    {}

func (m *ImagesTransformResponse) GetImage() *ImageData {
	if m != nil {
		return m.Image
	}
	return nil
}

func (m *ImagesTransformResponse) GetSourceMetadata() string {
	if m != nil && m.SourceMetadata != nil {
		return *m.SourceMetadata
	}
	return ""
}

type CompositeImageOptions struct {
	SourceIndex      *int32                        `protobuf:"varint,1,req,name=source_index" json:"source_index,omitempty"`
	XOffset          *int32                        `protobuf:"varint,2,req,name=x_offset" json:"x_offset,omitempty"`
	YOffset          *int32                        `protobuf:"varint,3,req,name=y_offset" json:"y_offset,omitempty"`
	Opacity          *float32                      `protobuf:"fixed32,4,req,name=opacity" json:"opacity,omitempty"`
	Anchor           *CompositeImageOptions_ANCHOR `protobuf:"varint,5,req,name=anchor,enum=appengine.CompositeImageOptions_ANCHOR" json:"anchor,omitempty"`
	XXX_unrecognized []byte                        `json:"-"`
}

func (m *CompositeImageOptions) Reset()         { *m = CompositeImageOptions{} }
func (m *CompositeImageOptions) String() string { return proto.CompactTextString(m) }
func (*CompositeImageOptions) ProtoMessage()    {}

func (m *CompositeImageOptions) GetSourceIndex() int32 {
	if m != nil && m.SourceIndex != nil {
		return *m.SourceIndex
	}
	return 0
}

func (m *CompositeImageOptions) GetXOffset() int32 {
	if m != nil && m.XOffset != nil {
		return *m.XOffset
	}
	return 0
}

func (m *CompositeImageOptions) GetYOffset() int32 {
	if m != nil && m.YOffset != nil {
		return *m.YOffset
	}
	return 0
}

func (m *CompositeImageOptions) GetOpacity() float32 {
	if m != nil && m.Opacity != nil {
		return *m.Opacity
	}
	return 0
}

func (m *CompositeImageOptions) GetAnchor() CompositeImageOptions_ANCHOR {
	if m != nil && m.Anchor != nil {
		return *m.Anchor
	}
	return CompositeImageOptions_TOP_LEFT
}

type ImagesCanvas struct {
	Width            *int32          `protobuf:"varint,1,req,name=width" json:"width,omitempty"`
	Height           *int32          `protobuf:"varint,2,req,name=height" json:"height,omitempty"`
	Output           *OutputSettings `protobuf:"bytes,3,req,name=output" json:"output,omitempty"`
	Color            *int32          `protobuf:"varint,4,opt,name=color,def=-1" json:"color,omitempty"`
	XXX_unrecognized []byte          `json:"-"`
}

func (m *ImagesCanvas) Reset()         { *m = ImagesCanvas{} }
func (m *ImagesCanvas) String() string { return proto.CompactTextString(m) }
func (*ImagesCanvas) ProtoMessage()    {}

const Default_ImagesCanvas_Color int32 = -1

func (m *ImagesCanvas) GetWidth() int32 {
	if m != nil && m.Width != nil {
		return *m.Width
	}
	return 0
}

func (m *ImagesCanvas) GetHeight() int32 {
	if m != nil && m.Height != nil {
		return *m.Height
	}
	return 0
}

func (m *ImagesCanvas) GetOutput() *OutputSettings {
	if m != nil {
		return m.Output
	}
	return nil
}

func (m *ImagesCanvas) GetColor() int32 {
	if m != nil && m.Color != nil {
		return *m.Color
	}
	return Default_ImagesCanvas_Color
}

type ImagesCompositeRequest struct {
	Image            []*ImageData             `protobuf:"bytes,1,rep,name=image" json:"image,omitempty"`
	Options          []*CompositeImageOptions `protobuf:"bytes,2,rep,name=options" json:"options,omitempty"`
	Canvas           *ImagesCanvas            `protobuf:"bytes,3,req,name=canvas" json:"canvas,omitempty"`
	XXX_unrecognized []byte                   `json:"-"`
}

func (m *ImagesCompositeRequest) Reset()         { *m = ImagesCompositeRequest{} }
func (m *ImagesCompositeRequest) String() string { return proto.CompactTextString(m) }
func (*ImagesCompositeRequest) ProtoMessage()    {}

func (m *ImagesCompositeRequest) GetImage() []*ImageData {
	if m != nil {
		return m.Image
	}
	return nil
}

func (m *ImagesCompositeRequest) GetOptions() []*CompositeImageOptions {
	if m != nil {
		return m.Options
	}
	return nil
}

func (m *ImagesCompositeRequest) GetCanvas() *ImagesCanvas {
	if m != nil {
		return m.Canvas
	}
	return nil
}

type ImagesCompositeResponse struct {
	Image            *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"`
	XXX_unrecognized []byte     `json:"-"`
}

func (m *ImagesCompositeResponse) Reset()         { *m = ImagesCompositeResponse{} }
func (m *ImagesCompositeResponse) String() string { return proto.CompactTextString(m) }
func (*ImagesCompositeResponse) ProtoMessage()    {}

func (m *ImagesCompositeResponse) GetImage() *ImageData {
	if m != nil {
		return m.Image
	}
	return nil
}

type ImagesHistogramRequest struct {
	Image            *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"`
	XXX_unrecognized []byte     `json:"-"`
}

func (m *ImagesHistogramRequest) Reset()         { *m = ImagesHistogramRequest{} }
func (m *ImagesHistogramRequest) String() string { return proto.CompactTextString(m) }
func (*ImagesHistogramRequest) ProtoMessage()    {}

func (m *ImagesHistogramRequest) GetImage() *ImageData {
	if m != nil {
		return m.Image
	}
	return nil
}

type ImagesHistogram struct {
	Red              []int32 `protobuf:"varint,1,rep,name=red" json:"red,omitempty"`
	Green            []int32 `protobuf:"varint,2,rep,name=green" json:"green,omitempty"`
	Blue             []int32 `protobuf:"varint,3,rep,name=blue" json:"blue,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *ImagesHistogram) Reset()         { *m = ImagesHistogram{} }
func (m *ImagesHistogram) String() string { return proto.CompactTextString(m) }
func (*ImagesHistogram) ProtoMessage()    {}

func (m *ImagesHistogram) GetRed() []int32 {
	if m != nil {
		return m.Red
	}
	return nil
}

func (m *ImagesHistogram) GetGreen() []int32 {
	if m != nil {
		return m.Green
	}
	return nil
}

func (m *ImagesHistogram) GetBlue() []int32 {
	if m != nil {
		return m.Blue
	}
	return nil
}

type ImagesHistogramResponse struct {
	Histogram        *ImagesHistogram `protobuf:"bytes,1,req,name=histogram" json:"histogram,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

func (m *ImagesHistogramResponse) Reset()         { *m = ImagesHistogramResponse{} }
func (m *ImagesHistogramResponse) String() string { return proto.CompactTextString(m) }
func (*ImagesHistogramResponse) ProtoMessage()    {}

func (m *ImagesHistogramResponse) GetHistogram() *ImagesHistogram {
	if m != nil {
		return m.Histogram
	}
	return nil
}

type ImagesGetUrlBaseRequest struct {
	BlobKey          *string `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"`
	CreateSecureUrl  *bool   `protobuf:"varint,2,opt,name=create_secure_url,def=0" json:"create_secure_url,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *ImagesGetUrlBaseRequest) Reset()         { *m = ImagesGetUrlBaseRequest{} }
func (m *ImagesGetUrlBaseRequest) String() string { return proto.CompactTextString(m) }
func (*ImagesGetUrlBaseRequest) ProtoMessage()    {}

const Default_ImagesGetUrlBaseRequest_CreateSecureUrl bool = false

func (m *ImagesGetUrlBaseRequest) GetBlobKey() string {
	if m != nil && m.BlobKey != nil {
		return *m.BlobKey
	}
	return ""
}

func (m *ImagesGetUrlBaseRequest) GetCreateSecureUrl() bool {
	if m != nil && m.CreateSecureUrl != nil {
		return *m.CreateSecureUrl
	}
	return Default_ImagesGetUrlBaseRequest_CreateSecureUrl
}

type ImagesGetUrlBaseResponse struct {
	Url              *string `protobuf:"bytes,1,req,name=url" json:"url,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *ImagesGetUrlBaseResponse) Reset()         { *m = ImagesGetUrlBaseResponse{} }
func (m *ImagesGetUrlBaseResponse) String() string { return proto.CompactTextString(m) }
func (*ImagesGetUrlBaseResponse) ProtoMessage()    {}

func (m *ImagesGetUrlBaseResponse) GetUrl() string {
	if m != nil && m.Url != nil {
		return *m.Url
	}
	return ""
}

type ImagesDeleteUrlBaseRequest struct {
	BlobKey          *string `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *ImagesDeleteUrlBaseRequest) Reset()         { *m = ImagesDeleteUrlBaseRequest{} }
func (m *ImagesDeleteUrlBaseRequest) String() string { return proto.CompactTextString(m) }
func (*ImagesDeleteUrlBaseRequest) ProtoMessage()    {}

func (m *ImagesDeleteUrlBaseRequest) GetBlobKey() string {
	if m != nil && m.BlobKey != nil {
		return *m.BlobKey
	}
	return ""
}

type ImagesDeleteUrlBaseResponse struct {
	XXX_unrecognized []byte `json:"-"`
}

func (m *ImagesDeleteUrlBaseResponse) Reset()         { *m = ImagesDeleteUrlBaseResponse{} }
func (m *ImagesDeleteUrlBaseResponse) String() string { return proto.CompactTextString(m) }
func (*ImagesDeleteUrlBaseResponse) ProtoMessage()    {}

func init() {
}


text:
syntax = "proto2";
option go_package = "image";

package appengine;

message ImagesServiceError {
  enum ErrorCode {
    UNSPECIFIED_ERROR = 1;
    BAD_TRANSFORM_DATA = 2;
    NOT_IMAGE = 3;
    BAD_IMAGE_DATA = 4;
    IMAGE_TOO_LARGE = 5;
    INVALID_BLOB_KEY = 6;
    ACCESS_DENIED = 7;
    OBJECT_NOT_FOUND = 8;
  }
}

message ImagesServiceTransform {
  enum Type {
    RESIZE = 1;
    ROTATE = 2;
    HORIZONTAL_FLIP = 3;
    VERTICAL_FLIP = 4;
    CROP = 5;
    IM_FEELING_LUCKY = 6;
  }
}

message Transform {
  optional int32 width = 1;
  optional int32 height = 2;
  optional bool crop_to_fit = 11 [default = false];
  optional float crop_offset_x = 12 [default = 0.5];
  optional float crop_offset_y = 13 [default = 0.5];

  optional int32 rotate = 3 [default = 0];

  optional bool horizontal_flip = 4 [default = false];

  optional bool vertical_flip = 5 [default = false];

  optional float crop_left_x = 6 [default = 0.0];
  optional float crop_top_y = 7 [default = 0.0];
  optional float crop_right_x = 8 [default = 1.0];
  optional float crop_bottom_y = 9 [default = 1.0];

  optional bool autolevels = 10 [default = false];

  optional bool allow_stretch = 14 [default = false];
}

message ImageData {
  required bytes content = 1 [ctype=CORD];
  optional string blob_key = 2;

  optional int32 width = 3;
  optional int32 height = 4;
}

message InputSettings {
  enum ORIENTATION_CORRECTION_TYPE {
    UNCHANGED_ORIENTATION = 0;
    CORRECT_ORIENTATION = 1;
  }
  optional ORIENTATION_CORRECTION_TYPE correct_exif_orientation = 1
      [default=UNCHANGED_ORIENTATION];
  optional bool parse_metadata = 2 [default=false];
  optional int32 transparent_substitution_rgb = 3;
}

message OutputSettings {
  enum MIME_TYPE {
    PNG = 0;
    JPEG = 1;
    WEBP = 2;
  }

  optional MIME_TYPE mime_type = 1 [default=PNG];
  optional int32 quality = 2;
}

message ImagesTransformRequest {
  required ImageData image = 1;
  repeated Transform transform = 2;
  required OutputSettings output = 3;
  optional InputSettings input = 4;
}

message ImagesTransformResponse {
  required ImageData image = 1;
  optional string source_metadata = 2;
}

message CompositeImageOptions {
  required int32 source_index = 1;
  required int32 x_offset = 2;
  required int32 y_offset = 3;
  required float opacity = 4;

  enum ANCHOR {
    TOP_LEFT = 0;
    TOP = 1;
    TOP_RIGHT = 2;
    LEFT = 3;
    CENTER = 4;
    RIGHT = 5;
    BOTTOM_LEFT = 6;
    BOTTOM = 7;
    BOTTOM_RIGHT = 8;
  }

  required ANCHOR anchor = 5;
}

message ImagesCanvas {
  required int32 width = 1;
  required int32 height = 2;
  required OutputSettings output = 3;
  optional int32 color = 4 [default=-1];
}

message ImagesCompositeRequest {
  repeated ImageData image = 1;
  repeated CompositeImageOptions options = 2;
  required ImagesCanvas canvas = 3;
}

message ImagesCompositeResponse {
  required ImageData image = 1;
}

message ImagesHistogramRequest {
  required ImageData image = 1;
}

message ImagesHistogram {
  repeated int32 red = 1;
  repeated int32 green = 2;
  repeated int32 blue = 3;
}

message ImagesHistogramResponse {
  required ImagesHistogram histogram = 1;
}

message ImagesGetUrlBaseRequest {
  required string blob_key = 1;

  optional bool create_secure_url = 2 [default = false];
}

message ImagesGetUrlBaseResponse {
  required string url = 1;
}

message ImagesDeleteUrlBaseRequest {
  required string blob_key = 1;
}

message ImagesDeleteUrlBaseResponse {
}

repo_name: dan-v/dosxvpn

repo_language: Go

mime_type: text/x-shellscript


text:
syntax = "proto2";
option go_package = "urlfetch";

package appengine;

message URLFetchServiceError {
  enum ErrorCode {
    OK = 0;
    INVALID_URL = 1;
    FETCH_ERROR = 2;
    UNSPECIFIED_ERROR = 3;
    RESPONSE_TOO_LARGE = 4;
    DEADLINE_EXCEEDED = 5;
    SSL_CERTIFICATE_ERROR = 6;
    DNS_ERROR = 7;
    CLOSED = 8;
    INTERNAL_TRANSIENT_ERROR = 9;
    TOO_MANY_REDIRECTS = 10;
    MALFORMED_REPLY = 11;
    CONNECTION_ERROR = 12;
  }
}

message URLFetchRequest {
  enum RequestMethod {
    GET = 1;
    POST = 2;
    HEAD = 3;
    PUT = 4;
    DELETE = 5;
    PATCH = 6;
  }
  required RequestMethod Method = 1;
  required string Url = 2;
  repeated group Header = 3 {
    required string Key = 4;
    required string Value = 5;
  }
  optional bytes Payload = 6 [ctype=CORD];

  optional bool FollowRedirects = 7 [default=true];

  optional double Deadline = 8;

  optional bool MustValidateServerCertificate = 9 [default=true];
}

message URLFetchResponse {
  optional bytes Content = 1;
  required int32 StatusCode = 2;
  repeated group Header = 3 {
    required string Key = 4;
    required string Value = 5;
  }
  optional bool ContentWasTruncated = 6 [default=false];
  optional int64 ExternalBytesSent = 7;
  optional int64 ExternalBytesReceived = 8;

  optional string FinalUrl = 9;

  optional int64 ApiCpuMilliseconds = 10 [default=0];
  optional int64 ApiBytesSent = 11 [default=0];
  optional int64 ApiBytesReceived = 12 [default=0];
}


text:
// Code generated by protoc-gen-go.
// source: google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto
// DO NOT EDIT!

/*
Package urlfetch is a generated protocol buffer package.

It is generated from these files:
	google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto

It has these top-level messages:
	URLFetchServiceError
	URLFetchRequest
	URLFetchResponse
*/
package urlfetch

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

type URLFetchServiceError_ErrorCode int32

const (
	URLFetchServiceError_OK                       URLFetchServiceError_ErrorCode = 0
	URLFetchServiceError_INVALID_URL              URLFetchServiceError_ErrorCode = 1
	URLFetchServiceError_FETCH_ERROR              URLFetchServiceError_ErrorCode = 2
	URLFetchServiceError_UNSPECIFIED_ERROR        URLFetchServiceError_ErrorCode = 3
	URLFetchServiceError_RESPONSE_TOO_LARGE       URLFetchServiceError_ErrorCode = 4
	URLFetchServiceError_DEADLINE_EXCEEDED        URLFetchServiceError_ErrorCode = 5
	URLFetchServiceError_SSL_CERTIFICATE_ERROR    URLFetchServiceError_ErrorCode = 6
	URLFetchServiceError_DNS_ERROR                URLFetchServiceError_ErrorCode = 7
	URLFetchServiceError_CLOSED                   URLFetchServiceError_ErrorCode = 8
	URLFetchServiceError_INTERNAL_TRANSIENT_ERROR URLFetchServiceError_ErrorCode = 9
	URLFetchServiceError_TOO_MANY_REDIRECTS       URLFetchServiceError_ErrorCode = 10
	URLFetchServiceError_MALFORMED_REPLY          URLFetchServiceError_ErrorCode = 11
	URLFetchServiceError_CONNECTION_ERROR         URLFetchServiceError_ErrorCode = 12
)

var URLFetchServiceError_ErrorCode_name = map[int32]string{
	0:  "OK",
	1:  "INVALID_URL",
	2:  "FETCH_ERROR",
	3:  "UNSPECIFIED_ERROR",
	4:  "RESPONSE_TOO_LARGE",
	5:  "DEADLINE_EXCEEDED",
	6:  "SSL_CERTIFICATE_ERROR",
	7:  "DNS_ERROR",
	8:  "CLOSED",
	9:  "INTERNAL_TRANSIENT_ERROR",
	10: "TOO_MANY_REDIRECTS",
	11: "MALFORMED_REPLY",
	12: "CONNECTION_ERROR",
}
var URLFetchServiceError_ErrorCode_value = map[string]int32{
	"OK":                       0,
	"INVALID_URL":              1,
	"FETCH_ERROR":              2,
	"UNSPECIFIED_ERROR":        3,
	"RESPONSE_TOO_LARGE":       4,
	"DEADLINE_EXCEEDED":        5,
	"SSL_CERTIFICATE_ERROR":    6,
	"DNS_ERROR":                7,
	"CLOSED":                   8,
	"INTERNAL_TRANSIENT_ERROR": 9,
	"TOO_MANY_REDIRECTS":       10,
	"MALFORMED_REPLY":          11,
	"CONNECTION_ERROR":         12,
}

func (x URLFetchServiceError_ErrorCode) Enum() *URLFetchServiceError_ErrorCode {
	p := new(URLFetchServiceError_ErrorCode)
	*p = x
	return p
}
func (x URLFetchServiceError_ErrorCode) String() string {
	return proto.EnumName(URLFetchServiceError_ErrorCode_name, int32(x))
}
func (x *URLFetchServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(URLFetchServiceError_ErrorCode_value, data, "URLFetchServiceError_ErrorCode")
	if err != nil {
		return err
	}
	*x = URLFetchServiceError_ErrorCode(value)
	return nil
}

type URLFetchRequest_RequestMethod int32

const (
	URLFetchRequest_GET    URLFetchRequest_RequestMethod = 1
	URLFetchRequest_POST   URLFetchRequest_RequestMethod = 2
	URLFetchRequest_HEAD   URLFetchRequest_RequestMethod = 3
	URLFetchRequest_PUT    URLFetchRequest_RequestMethod = 4
	URLFetchRequest_DELETE URLFetchRequest_RequestMethod = 5
	URLFetchRequest_PATCH  URLFetchRequest_RequestMethod = 6
)

var URLFetchRequest_RequestMethod_name = map[int32]string{
	1: "GET",
	2: "POST",
	3: "HEAD",
	4: "PUT",
	5: "DELETE",
	6: "PATCH",
}
var URLFetchRequest_RequestMethod_value = map[string]int32{
	"GET":    1,
	"POST":   2,
	"HEAD":   3,
	"PUT":    4,
	"DELETE": 5,
	"PATCH":  6,
}

func (x URLFetchRequest_RequestMethod) Enum() *URLFetchRequest_RequestMethod {
	p := new(URLFetchRequest_RequestMethod)
	*p = x
	return p
}
func (x URLFetchRequest_RequestMethod) String() string {
	return proto.EnumName(URLFetchRequest_RequestMethod_name, int32(x))
}
func (x *URLFetchRequest_RequestMethod) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(URLFetchRequest_RequestMethod_value, data, "URLFetchRequest_RequestMethod")
	if err != nil {
		return err
	}
	*x = URLFetchRequest_RequestMethod(value)
	return nil
}

type URLFetchServiceError struct {
	XXX_unrecognized []byte `json:"-"`
}

func (m *URLFetchServiceError) Reset()         { *m = URLFetchServiceError{} }
func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) }
func (*URLFetchServiceError) ProtoMessage()    {}

type URLFetchRequest struct {
	Method                        *URLFetchRequest_RequestMethod `protobuf:"varint,1,req,name=Method,enum=appengine.URLFetchRequest_RequestMethod" json:"Method,omitempty"`
	Url                           *string                        `protobuf:"bytes,2,req,name=Url" json:"Url,omitempty"`
	Header                        []*URLFetchRequest_Header      `protobuf:"group,3,rep,name=Header" json:"header,omitempty"`
	Payload                       []byte                         `protobuf:"bytes,6,opt,name=Payload" json:"Payload,omitempty"`
	FollowRedirects               *bool                          `protobuf:"varint,7,opt,name=FollowRedirects,def=1" json:"FollowRedirects,omitempty"`
	Deadline                      *float64                       `protobuf:"fixed64,8,opt,name=Deadline" json:"Deadline,omitempty"`
	MustValidateServerCertificate *bool                          `protobuf:"varint,9,opt,name=MustValidateServerCertificate,def=1" json:"MustValidateServerCertificate,omitempty"`
	XXX_unrecognized              []byte                         `json:"-"`
}

func (m *URLFetchRequest) Reset()         { *m = URLFetchRequest{} }
func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) }
func (*URLFetchRequest) ProtoMessage()    {}

const Default_URLFetchRequest_FollowRedirects bool = true
const Default_URLFetchRequest_MustValidateServerCertificate bool = true

func (m *URLFetchRequest) GetMethod() URLFetchRequest_RequestMethod {
	if m != nil && m.Method != nil {
		return *m.Method
	}
	return URLFetchRequest_GET
}

func (m *URLFetchRequest) GetUrl() string {
	if m != nil && m.Url != nil {
		return *m.Url
	}
	return ""
}

func (m *URLFetchRequest) GetHeader() []*URLFetchRequest_Header {
	if m != nil {
		return m.Header
	}
	return nil
}

func (m *URLFetchRequest) GetPayload() []byte {
	if m != nil {
		return m.Payload
	}
	return nil
}

func (m *URLFetchRequest) GetFollowRedirects() bool {
	if m != nil && m.FollowRedirects != nil {
		return *m.FollowRedirects
	}
	return Default_URLFetchRequest_FollowRedirects
}

func (m *URLFetchRequest) GetDeadline() float64 {
	if m != nil && m.Deadline != nil {
		return *m.Deadline
	}
	return 0
}

func (m *URLFetchRequest) GetMustValidateServerCertificate() bool {
	if m != nil && m.MustValidateServerCertificate != nil {
		return *m.MustValidateServerCertificate
	}
	return Default_URLFetchRequest_MustValidateServerCertificate
}

type URLFetchRequest_Header struct {
	Key              *string `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"`
	Value            *string `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *URLFetchRequest_Header) Reset()         { *m = URLFetchRequest_Header{} }
func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) }
func (*URLFetchRequest_Header) ProtoMessage()    {}

func (m *URLFetchRequest_Header) GetKey() string {
	if m != nil && m.Key != nil {
		return *m.Key
	}
	return ""
}

func (m *URLFetchRequest_Header) GetValue() string {
	if m != nil && m.Value != nil {
		return *m.Value
	}
	return ""
}

type URLFetchResponse struct {
	Content               []byte                     `protobuf:"bytes,1,opt,name=Content" json:"Content,omitempty"`
	StatusCode            *int32                     `protobuf:"varint,2,req,name=StatusCode" json:"StatusCode,omitempty"`
	Header                []*URLFetchResponse_Header `protobuf:"group,3,rep,name=Header" json:"header,omitempty"`
	ContentWasTruncated   *bool                      `protobuf:"varint,6,opt,name=ContentWasTruncated,def=0" json:"ContentWasTruncated,omitempty"`
	ExternalBytesSent     *int64                     `protobuf:"varint,7,opt,name=ExternalBytesSent" json:"ExternalBytesSent,omitempty"`
	ExternalBytesReceived *int64                     `protobuf:"varint,8,opt,name=ExternalBytesReceived" json:"ExternalBytesReceived,omitempty"`
	FinalUrl              *string                    `protobuf:"bytes,9,opt,name=FinalUrl" json:"FinalUrl,omitempty"`
	ApiCpuMilliseconds    *int64                     `protobuf:"varint,10,opt,name=ApiCpuMilliseconds,def=0" json:"ApiCpuMilliseconds,omitempty"`
	ApiBytesSent          *int64                     `protobuf:"varint,11,opt,name=ApiBytesSent,def=0" json:"ApiBytesSent,omitempty"`
	ApiBytesReceived      *int64                     `protobuf:"varint,12,opt,name=ApiBytesReceived,def=0" json:"ApiBytesReceived,omitempty"`
	XXX_unrecognized      []byte                     `json:"-"`
}

func (m *URLFetchResponse) Reset()         { *m = URLFetchResponse{} }
func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) }
func (*URLFetchResponse) ProtoMessage()    {}

const Default_URLFetchResponse_ContentWasTruncated bool = false
const Default_URLFetchResponse_ApiCpuMilliseconds int64 = 0
const Default_URLFetchResponse_ApiBytesSent int64 = 0
const Default_URLFetchResponse_ApiBytesReceived int64 = 0

func (m *URLFetchResponse) GetContent() []byte {
	if m != nil {
		return m.Content
	}
	return nil
}

func (m *URLFetchResponse) GetStatusCode() int32 {
	if m != nil && m.StatusCode != nil {
		return *m.StatusCode
	}
	return 0
}

func (m *URLFetchResponse) GetHeader() []*URLFetchResponse_Header {
	if m != nil {
		return m.Header
	}
	return nil
}

func (m *URLFetchResponse) GetContentWasTruncated() bool {
	if m != nil && m.ContentWasTruncated != nil {
		return *m.ContentWasTruncated
	}
	return Default_URLFetchResponse_ContentWasTruncated
}

func (m *URLFetchResponse) GetExternalBytesSent() int64 {
	if m != nil && m.ExternalBytesSent != nil {
		return *m.ExternalBytesSent
	}
	return 0
}

func (m *URLFetchResponse) GetExternalBytesReceived() int64 {
	if m != nil && m.ExternalBytesReceived != nil {
		return *m.ExternalBytesReceived
	}
	return 0
}

func (m *URLFetchResponse) GetFinalUrl() string {
	if m != nil && m.FinalUrl != nil {
		return *m.FinalUrl
	}
	return ""
}

func (m *URLFetchResponse) GetApiCpuMilliseconds() int64 {
	if m != nil && m.ApiCpuMilliseconds != nil {
		return *m.ApiCpuMilliseconds
	}
	return Default_URLFetchResponse_ApiCpuMilliseconds
}

func (m *URLFetchResponse) GetApiBytesSent() int64 {
	if m != nil && m.ApiBytesSent != nil {
		return *m.ApiBytesSent
	}
	return Default_URLFetchResponse_ApiBytesSent
}

func (m *URLFetchResponse) GetApiBytesReceived() int64 {
	if m != nil && m.ApiBytesReceived != nil {
		return *m.ApiBytesReceived
	}
	return Default_URLFetchResponse_ApiBytesReceived
}

type URLFetchResponse_Header struct {
	Key              *string `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"`
	Value            *string `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *URLFetchResponse_Header) Reset()         { *m = URLFetchResponse_Header{} }
func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) }
func (*URLFetchResponse_Header) ProtoMessage()    {}

func (m *URLFetchResponse_Header) GetKey() string {
	if m != nil && m.Key != nil {
		return *m.Key
	}
	return ""
}

func (m *URLFetchResponse_Header) GetValue() string {
	if m != nil && m.Value != nil {
		return *m.Value
	}
	return ""
}

func init() {
}


text:
// Code generated by protoc-gen-go.
// source: google.golang.org/appengine/internal/mail/mail_service.proto
// DO NOT EDIT!

/*
Package mail is a generated protocol buffer package.

It is generated from these files:
	google.golang.org/appengine/internal/mail/mail_service.proto

It has these top-level messages:
	MailServiceError
	MailAttachment
	MailHeader
	MailMessage
*/
package mail

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

type MailServiceError_ErrorCode int32

const (
	MailServiceError_OK                      MailServiceError_ErrorCode = 0
	MailServiceError_INTERNAL_ERROR          MailServiceError_ErrorCode = 1
	MailServiceError_BAD_REQUEST             MailServiceError_ErrorCode = 2
	MailServiceError_UNAUTHORIZED_SENDER     MailServiceError_ErrorCode = 3
	MailServiceError_INVALID_ATTACHMENT_TYPE MailServiceError_ErrorCode = 4
	MailServiceError_INVALID_HEADER_NAME     MailServiceError_ErrorCode = 5
	MailServiceError_INVALID_CONTENT_ID      MailServiceError_ErrorCode = 6
)

var MailServiceError_ErrorCode_name = map[int32]string{
	0: "OK",
	1: "INTERNAL_ERROR",
	2: "BAD_REQUEST",
	3: "UNAUTHORIZED_SENDER",
	4: "INVALID_ATTACHMENT_TYPE",
	5: "INVALID_HEADER_NAME",
	6: "INVALID_CONTENT_ID",
}
var MailServiceError_ErrorCode_value = map[string]int32{
	"OK":                      0,
	"INTERNAL_ERROR":          1,
	"BAD_REQUEST":             2,
	"UNAUTHORIZED_SENDER":     3,
	"INVALID_ATTACHMENT_TYPE": 4,
	"INVALID_HEADER_NAME":     5,
	"INVALID_CONTENT_ID":      6,
}

func (x MailServiceError_ErrorCode) Enum() *MailServiceError_ErrorCode {
	p := new(MailServiceError_ErrorCode)
	*p = x
	return p
}
func (x MailServiceError_ErrorCode) String() string {
	return proto.EnumName(MailServiceError_ErrorCode_name, int32(x))
}
func (x *MailServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(MailServiceError_ErrorCode_value, data, "MailServiceError_ErrorCode")
	if err != nil {
		return err
	}
	*x = MailServiceError_ErrorCode(value)
	return nil
}

type MailServiceError struct {
	XXX_unrecognized []byte `json:"-"`
}

func (m *MailServiceError) Reset()         { *m = MailServiceError{} }
func (m *MailServiceError) String() string { return proto.CompactTextString(m) }
func (*MailServiceError) ProtoMessage()    {}

type MailAttachment struct {
	FileName         *string `protobuf:"bytes,1,req,name=FileName" json:"FileName,omitempty"`
	Data             []byte  `protobuf:"bytes,2,req,name=Data" json:"Data,omitempty"`
	ContentID        *string `protobuf:"bytes,3,opt,name=ContentID" json:"ContentID,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *MailAttachment) Reset()         { *m = MailAttachment{} }
func (m *MailAttachment) String() string { return proto.CompactTextString(m) }
func (*MailAttachment) ProtoMessage()    {}

func (m *MailAttachment) GetFileName() string {
	if m != nil && m.FileName != nil {
		return *m.FileName
	}
	return ""
}

func (m *MailAttachment) GetData() []byte {
	if m != nil {
		return m.Data
	}
	return nil
}

func (m *MailAttachment) GetContentID() string {
	if m != nil && m.ContentID != nil {
		return *m.ContentID
	}
	return ""
}

type MailHeader struct {
	Name             *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Value            *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *MailHeader) Reset()         { *m = MailHeader{} }
func (m *MailHeader) String() string { return proto.CompactTextString(m) }
func (*MailHeader) ProtoMessage()    {}

func (m *MailHeader) GetName() string {
	if m != nil && m.Name != nil {
		return *m.Name
	}
	return ""
}

func (m *MailHeader) GetValue() string {
	if m != nil && m.Value != nil {
		return *m.Value
	}
	return ""
}

type MailMessage struct {
	Sender           *string           `protobuf:"bytes,1,req,name=Sender" json:"Sender,omitempty"`
	ReplyTo          *string           `protobuf:"bytes,2,opt,name=ReplyTo" json:"ReplyTo,omitempty"`
	To               []string          `protobuf:"bytes,3,rep,name=To" json:"To,omitempty"`
	Cc               []string          `protobuf:"bytes,4,rep,name=Cc" json:"Cc,omitempty"`
	Bcc              []string          `protobuf:"bytes,5,rep,name=Bcc" json:"Bcc,omitempty"`
	Subject          *string           `protobuf:"bytes,6,req,name=Subject" json:"Subject,omitempty"`
	TextBody         *string           `protobuf:"bytes,7,opt,name=TextBody" json:"TextBody,omitempty"`
	HtmlBody         *string           `protobuf:"bytes,8,opt,name=HtmlBody" json:"HtmlBody,omitempty"`
	Attachment       []*MailAttachment `protobuf:"bytes,9,rep,name=Attachment" json:"Attachment,omitempty"`
	Header           []*MailHeader     `protobuf:"bytes,10,rep,name=Header" json:"Header,omitempty"`
	XXX_unrecognized []byte            `json:"-"`
}

func (m *MailMessage) Reset()         { *m = MailMessage{} }
func (m *MailMessage) String() string { return proto.CompactTextString(m) }
func (*MailMessage) ProtoMessage()    {}

func (m *MailMessage) GetSender() string {
	if m != nil && m.Sender != nil {
		return *m.Sender
	}
	return ""
}

func (m *MailMessage) GetReplyTo() string {
	if m != nil && m.ReplyTo != nil {
		return *m.ReplyTo
	}
	return ""
}

func (m *MailMessage) GetTo() []string {
	if m != nil {
		return m.To
	}
	return nil
}

func (m *MailMessage) GetCc() []string {
	if m != nil {
		return m.Cc
	}
	return nil
}

func (m *MailMessage) GetBcc() []string {
	if m != nil {
		return m.Bcc
	}
	return nil
}

func (m *MailMessage) GetSubject() string {
	if m != nil && m.Subject != nil {
		return *m.Subject
	}
	return ""
}

func (m *MailMessage) GetTextBody() string {
	if m != nil && m.TextBody != nil {
		return *m.TextBody
	}
	return ""
}

func (m *MailMessage) GetHtmlBody() string {
	if m != nil && m.HtmlBody != nil {
		return *m.HtmlBody
	}
	return ""
}

func (m *MailMessage) GetAttachment() []*MailAttachment {
	if m != nil {
		return m.Attachment
	}
	return nil
}

func (m *MailMessage) GetHeader() []*MailHeader {
	if m != nil {
		return m.Header
	}
	return nil
}

func init() {
}


text:
syntax = "proto2";
option go_package = "mail";

package appengine;

message MailServiceError {
  enum ErrorCode {
    OK = 0;
    INTERNAL_ERROR = 1;
    BAD_REQUEST = 2;
    UNAUTHORIZED_SENDER = 3;
    INVALID_ATTACHMENT_TYPE = 4;
    INVALID_HEADER_NAME = 5;
    INVALID_CONTENT_ID = 6;
  }
}

message MailAttachment {
  required string FileName = 1;
  required bytes Data = 2;
  optional string ContentID = 3;
}

message MailHeader {
  required string name = 1;
  required string value = 2;
}

message MailMessage {
  required string Sender = 1;
  optional string ReplyTo = 2;

  repeated string To = 3;
  repeated string Cc = 4;
  repeated string Bcc = 5;

  required string Subject = 6;

  optional string TextBody = 7;
  optional string HtmlBody = 8;

  repeated MailAttachment Attachment = 9;

  repeated MailHeader Header = 10;
}


text:
syntax = "proto2";
option go_package = "capability";

package appengine;

message IsEnabledRequest {
  required string package = 1;
  repeated string capability = 2;
  repeated string call = 3;
}

message IsEnabledResponse {
  enum SummaryStatus {
    DEFAULT = 0;
    ENABLED = 1;
    SCHEDULED_FUTURE = 2;
    SCHEDULED_NOW = 3;
    DISABLED = 4;
    UNKNOWN = 5;
  }
  optional SummaryStatus summary_status = 1;

  optional int64 time_until_scheduled = 2;
}

service CapabilityService {
  rpc IsEnabled(IsEnabledRequest) returns (IsEnabledResponse) {};
}


text:
// Code generated by protoc-gen-go.
// source: google.golang.org/appengine/internal/capability/capability_service.proto
// DO NOT EDIT!

/*
Package capability is a generated protocol buffer package.

It is generated from these files:
	google.golang.org/appengine/internal/capability/capability_service.proto

It has these top-level messages:
	IsEnabledRequest
	IsEnabledResponse
*/
package capability

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

type IsEnabledResponse_SummaryStatus int32

const (
	IsEnabledResponse_DEFAULT          IsEnabledResponse_SummaryStatus = 0
	IsEnabledResponse_ENABLED          IsEnabledResponse_SummaryStatus = 1
	IsEnabledResponse_SCHEDULED_FUTURE IsEnabledResponse_SummaryStatus = 2
	IsEnabledResponse_SCHEDULED_NOW    IsEnabledResponse_SummaryStatus = 3
	IsEnabledResponse_DISABLED         IsEnabledResponse_SummaryStatus = 4
	IsEnabledResponse_UNKNOWN          IsEnabledResponse_SummaryStatus = 5
)

var IsEnabledResponse_SummaryStatus_name = map[int32]string{
	0: "DEFAULT",
	1: "ENABLED",
	2: "SCHEDULED_FUTURE",
	3: "SCHEDULED_NOW",
	4: "DISABLED",
	5: "UNKNOWN",
}
var IsEnabledResponse_SummaryStatus_value = map[string]int32{
	"DEFAULT":          0,
	"ENABLED":          1,
	"SCHEDULED_FUTURE": 2,
	"SCHEDULED_NOW":    3,
	"DISABLED":         4,
	"UNKNOWN":          5,
}

func (x IsEnabledResponse_SummaryStatus) Enum() *IsEnabledResponse_SummaryStatus {
	p := new(IsEnabledResponse_SummaryStatus)
	*p = x
	return p
}
func (x IsEnabledResponse_SummaryStatus) String() string {
	return proto.EnumName(IsEnabledResponse_SummaryStatus_name, int32(x))
}
func (x *IsEnabledResponse_SummaryStatus) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(IsEnabledResponse_SummaryStatus_value, data, "IsEnabledResponse_SummaryStatus")
	if err != nil {
		return err
	}
	*x = IsEnabledResponse_SummaryStatus(value)
	return nil
}

type IsEnabledRequest struct {
	Package          *string  `protobuf:"bytes,1,req,name=package" json:"package,omitempty"`
	Capability       []string `protobuf:"bytes,2,rep,name=capability" json:"capability,omitempty"`
	Call             []string `protobuf:"bytes,3,rep,name=call" json:"call,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (m *IsEnabledRequest) Reset()         { *m = IsEnabledRequest{} }
func (m *IsEnabledRequest) String() string { return proto.CompactTextString(m) }
func (*IsEnabledRequest) ProtoMessage()    {}

func (m *IsEnabledRequest) GetPackage() string {
	if m != nil && m.Package != nil {
		return *m.Package
	}
	return ""
}

func (m *IsEnabledRequest) GetCapability() []string {
	if m != nil {
		return m.Capability
	}
	return nil
}

func (m *IsEnabledRequest) GetCall() []string {
	if m != nil {
		return m.Call
	}
	return nil
}

type IsEnabledResponse struct {
	SummaryStatus      *IsEnabledResponse_SummaryStatus `protobuf:"varint,1,opt,name=summary_status,enum=appengine.IsEnabledResponse_SummaryStatus" json:"summary_status,omitempty"`
	TimeUntilScheduled *int64                           `protobuf:"varint,2,opt,name=time_until_scheduled" json:"time_until_scheduled,omitempty"`
	XXX_unrecognized   []byte                           `json:"-"`
}

func (m *IsEnabledResponse) Reset()         { *m = IsEnabledResponse{} }
func (m *IsEnabledResponse) String() string { return proto.CompactTextString(m) }
func (*IsEnabledResponse) ProtoMessage()    {}

func (m *IsEnabledResponse) GetSummaryStatus() IsEnabledResponse_SummaryStatus {
	if m != nil && m.SummaryStatus != nil {
		return *m.SummaryStatus
	}
	return IsEnabledResponse_DEFAULT
}

func (m *IsEnabledResponse) GetTimeUntilScheduled() int64 {
	if m != nil && m.TimeUntilScheduled != nil {
		return *m.TimeUntilScheduled
	}
	return 0
}


text:
// Code generated by protoc-gen-go.
// source: google.golang.org/appengine/internal/xmpp/xmpp_service.proto
// DO NOT EDIT!

/*
Package xmpp is a generated protocol buffer package.

It is generated from these files:
	google.golang.org/appengine/internal/xmpp/xmpp_service.proto

It has these top-level messages:
	XmppServiceError
	PresenceRequest
	PresenceResponse
	BulkPresenceRequest
	BulkPresenceResponse
	XmppMessageRequest
	XmppMessageResponse
	XmppSendPresenceRequest
	XmppSendPresenceResponse
	XmppInviteRequest
	XmppInviteResponse
*/
package xmpp

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

type XmppServiceError_ErrorCode int32

const (
	XmppServiceError_UNSPECIFIED_ERROR    XmppServiceError_ErrorCode = 1
	XmppServiceError_INVALID_JID          XmppServiceError_ErrorCode = 2
	XmppServiceError_NO_BODY              XmppServiceError_ErrorCode = 3
	XmppServiceError_INVALID_XML          XmppServiceError_ErrorCode = 4
	XmppServiceError_INVALID_TYPE         XmppServiceError_ErrorCode = 5
	XmppServiceError_INVALID_SHOW         XmppServiceError_ErrorCode = 6
	XmppServiceError_EXCEEDED_MAX_SIZE    XmppServiceError_ErrorCode = 7
	XmppServiceError_APPID_ALIAS_REQUIRED XmppServiceError_ErrorCode = 8
	XmppServiceError_NONDEFAULT_MODULE    XmppServiceError_ErrorCode = 9
)

var XmppServiceError_ErrorCode_name = map[int32]string{
	1: "UNSPECIFIED_ERROR",
	2: "INVALID_JID",
	3: "NO_BODY",
	4: "INVALID_XML",
	5: "INVALID_TYPE",
	6: "INVALID_SHOW",
	7: "EXCEEDED_MAX_SIZE",
	8: "APPID_ALIAS_REQUIRED",
	9: "NONDEFAULT_MODULE",
}
var XmppServiceError_ErrorCode_value = map[string]int32{
	"UNSPECIFIED_ERROR":    1,
	"INVALID_JID":          2,
	"NO_BODY":              3,
	"INVALID_XML":          4,
	"INVALID_TYPE":         5,
	"INVALID_SHOW":         6,
	"EXCEEDED_MAX_SIZE":    7,
	"APPID_ALIAS_REQUIRED": 8,
	"NONDEFAULT_MODULE":    9,
}

func (x XmppServiceError_ErrorCode) Enum() *XmppServiceError_ErrorCode {
	p := new(XmppServiceError_ErrorCode)
	*p = x
	return p
}
func (x XmppServiceError_ErrorCode) String() string {
	return proto.EnumName(XmppServiceError_ErrorCode_name, int32(x))
}
func (x *XmppServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(XmppServiceError_ErrorCode_value, data, "XmppServiceError_ErrorCode")
	if err != nil {
		return err
	}
	*x = XmppServiceError_ErrorCode(value)
	return nil
}

type PresenceResponse_SHOW int32

const (
	PresenceResponse_NORMAL         PresenceResponse_SHOW = 0
	PresenceResponse_AWAY           PresenceResponse_SHOW = 1
	PresenceResponse_DO_NOT_DISTURB PresenceResponse_SHOW = 2
	PresenceResponse_CHAT           PresenceResponse_SHOW = 3
	PresenceResponse_EXTENDED_AWAY  PresenceResponse_SHOW = 4
)

var PresenceResponse_SHOW_name = map[int32]string{
	0: "NORMAL",
	1: "AWAY",
	2: "DO_NOT_DISTURB",
	3: "CHAT",
	4: "EXTENDED_AWAY",
}
var PresenceResponse_SHOW_value = map[string]int32{
	"NORMAL":         0,
	"AWAY":           1,
	"DO_NOT_DISTURB": 2,
	"CHAT":           3,
	"EXTENDED_AWAY":  4,
}

func (x PresenceResponse_SHOW) Enum() *PresenceResponse_SHOW {
	p := new(PresenceResponse_SHOW)
	*p = x
	return p
}
func (x PresenceResponse_SHOW) String() string {
	return proto.EnumName(PresenceResponse_SHOW_name, int32(x))
}
func (x *PresenceResponse_SHOW) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(PresenceResponse_SHOW_value, data, "PresenceResponse_SHOW")
	if err != nil {
		return err
	}
	*x = PresenceResponse_SHOW(value)
	return nil
}

type XmppMessageResponse_XmppMessageStatus int32

const (
	XmppMessageResponse_NO_ERROR    XmppMessageResponse_XmppMessageStatus = 0
	XmppMessageResponse_INVALID_JID XmppMessageResponse_XmppMessageStatus = 1
	XmppMessageResponse_OTHER_ERROR XmppMessageResponse_XmppMessageStatus = 2
)

var XmppMessageResponse_XmppMessageStatus_name = map[int32]string{
	0: "NO_ERROR",
	1: "INVALID_JID",
	2: "OTHER_ERROR",
}
var XmppMessageResponse_XmppMessageStatus_value = map[string]int32{
	"NO_ERROR":    0,
	"INVALID_JID": 1,
	"OTHER_ERROR": 2,
}

func (x XmppMessageResponse_XmppMessageStatus) Enum() *XmppMessageResponse_XmppMessageStatus {
	p := new(XmppMessageResponse_XmppMessageStatus)
	*p = x
	return p
}
func (x XmppMessageResponse_XmppMessageStatus) String() string {
	return proto.EnumName(XmppMessageResponse_XmppMessageStatus_name, int32(x))
}
func (x *XmppMessageResponse_XmppMessageStatus) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(XmppMessageResponse_XmppMessageStatus_value, data, "XmppMessageResponse_XmppMessageStatus")
	if err != nil {
		return err
	}
	*x = XmppMessageResponse_XmppMessageStatus(value)
	return nil
}

type XmppServiceError struct {
	XXX_unrecognized []byte `json:"-"`
}

func (m *XmppServiceError) Reset()         { *m = XmppServiceError{} }
func (m *XmppServiceError) String() string { return proto.CompactTextString(m) }
func (*XmppServiceError) ProtoMessage()    {}

type PresenceRequest struct {
	Jid              *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`
	FromJid          *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *PresenceRequest) Reset()         { *m = PresenceRequest{} }
func (m *PresenceRequest) String() string { return proto.CompactTextString(m) }
func (*PresenceRequest) ProtoMessage()    {}

func (m *PresenceRequest) GetJid() string {
	if m != nil && m.Jid != nil {
		return *m.Jid
	}
	return ""
}

func (m *PresenceRequest) GetFromJid() string {
	if m != nil && m.FromJid != nil {
		return *m.FromJid
	}
	return ""
}

type PresenceResponse struct {
	IsAvailable      *bool                  `protobuf:"varint,1,req,name=is_available" json:"is_available,omitempty"`
	Presence         *PresenceResponse_SHOW `protobuf:"varint,2,opt,name=presence,enum=appengine.PresenceResponse_SHOW" json:"presence,omitempty"`
	Valid            *bool                  `protobuf:"varint,3,opt,name=valid" json:"valid,omitempty"`
	XXX_unrecognized []byte                 `json:"-"`
}

func (m *PresenceResponse) Reset()         { *m = PresenceResponse{} }
func (m *PresenceResponse) String() string { return proto.CompactTextString(m) }
func (*PresenceResponse) ProtoMessage()    {}

func (m *PresenceResponse) GetIsAvailable() bool {
	if m != nil && m.IsAvailable != nil {
		return *m.IsAvailable
	}
	return false
}

func (m *PresenceResponse) GetPresence() PresenceResponse_SHOW {
	if m != nil && m.Presence != nil {
		return *m.Presence
	}
	return PresenceResponse_NORMAL
}

func (m *PresenceResponse) GetValid() bool {
	if m != nil && m.Valid != nil {
		return *m.Valid
	}
	return false
}

type BulkPresenceRequest struct {
	Jid              []string `protobuf:"bytes,1,rep,name=jid" json:"jid,omitempty"`
	FromJid          *string  `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (m *BulkPresenceRequest) Reset()         { *m = BulkPresenceRequest{} }
func (m *BulkPresenceRequest) String() string { return proto.CompactTextString(m) }
func (*BulkPresenceRequest) ProtoMessage()    {}

func (m *BulkPresenceRequest) GetJid() []string {
	if m != nil {
		return m.Jid
	}
	return nil
}

func (m *BulkPresenceRequest) GetFromJid() string {
	if m != nil && m.FromJid != nil {
		return *m.FromJid
	}
	return ""
}

type BulkPresenceResponse struct {
	PresenceResponse []*PresenceResponse `protobuf:"bytes,1,rep,name=presence_response" json:"presence_response,omitempty"`
	XXX_unrecognized []byte              `json:"-"`
}

func (m *BulkPresenceResponse) Reset()         { *m = BulkPresenceResponse{} }
func (m *BulkPresenceResponse) String() string { return proto.CompactTextString(m) }
func (*BulkPresenceResponse) ProtoMessage()    {}

func (m *BulkPresenceResponse) GetPresenceResponse() []*PresenceResponse {
	if m != nil {
		return m.PresenceResponse
	}
	return nil
}

type XmppMessageRequest struct {
	Jid              []string `protobuf:"bytes,1,rep,name=jid" json:"jid,omitempty"`
	Body             *string  `protobuf:"bytes,2,req,name=body" json:"body,omitempty"`
	RawXml           *bool    `protobuf:"varint,3,opt,name=raw_xml,def=0" json:"raw_xml,omitempty"`
	Type             *string  `protobuf:"bytes,4,opt,name=type,def=chat" json:"type,omitempty"`
	FromJid          *string  `protobuf:"bytes,5,opt,name=from_jid" json:"from_jid,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (m *XmppMessageRequest) Reset()         { *m = XmppMessageRequest{} }
func (m *XmppMessageRequest) String() string { return proto.CompactTextString(m) }
func (*XmppMessageRequest) ProtoMessage()    {}

const Default_XmppMessageRequest_RawXml bool = false
const Default_XmppMessageRequest_Type string = "chat"

func (m *XmppMessageRequest) GetJid() []string {
	if m != nil {
		return m.Jid
	}
	return nil
}

func (m *XmppMessageRequest) GetBody() string {
	if m != nil && m.Body != nil {
		return *m.Body
	}
	return ""
}

func (m *XmppMessageRequest) GetRawXml() bool {
	if m != nil && m.RawXml != nil {
		return *m.RawXml
	}
	return Default_XmppMessageRequest_RawXml
}

func (m *XmppMessageRequest) GetType() string {
	if m != nil && m.Type != nil {
		return *m.Type
	}
	return Default_XmppMessageRequest_Type
}

func (m *XmppMessageRequest) GetFromJid() string {
	if m != nil && m.FromJid != nil {
		return *m.FromJid
	}
	return ""
}

type XmppMessageResponse struct {
	Status           []XmppMessageResponse_XmppMessageStatus `protobuf:"varint,1,rep,name=status,enum=appengine.XmppMessageResponse_XmppMessageStatus" json:"status,omitempty"`
	XXX_unrecognized []byte                                  `json:"-"`
}

func (m *XmppMessageResponse) Reset()         { *m = XmppMessageResponse{} }
func (m *XmppMessageResponse) String() string { return proto.CompactTextString(m) }
func (*XmppMessageResponse) ProtoMessage()    {}

func (m *XmppMessageResponse) GetStatus() []XmppMessageResponse_XmppMessageStatus {
	if m != nil {
		return m.Status
	}
	return nil
}

type XmppSendPresenceRequest struct {
	Jid              *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`
	Type             *string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
	Show             *string `protobuf:"bytes,3,opt,name=show" json:"show,omitempty"`
	Status           *string `protobuf:"bytes,4,opt,name=status" json:"status,omitempty"`
	FromJid          *string `protobuf:"bytes,5,opt,name=from_jid" json:"from_jid,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *XmppSendPresenceRequest) Reset()         { *m = XmppSendPresenceRequest{} }
func (m *XmppSendPresenceRequest) String() string { return proto.CompactTextString(m) }
func (*XmppSendPresenceRequest) ProtoMessage()    {}

func (m *XmppSendPresenceRequest) GetJid() string {
	if m != nil && m.Jid != nil {
		return *m.Jid
	}
	return ""
}

func (m *XmppSendPresenceRequest) GetType() string {
	if m != nil && m.Type != nil {
		return *m.Type
	}
	return ""
}

func (m *XmppSendPresenceRequest) GetShow() string {
	if m != nil && m.Show != nil {
		return *m.Show
	}
	return ""
}

func (m *XmppSendPresenceRequest) GetStatus() string {
	if m != nil && m.Status != nil {
		return *m.Status
	}
	return ""
}

func (m *XmppSendPresenceRequest) GetFromJid() string {
	if m != nil && m.FromJid != nil {
		return *m.FromJid
	}
	return ""
}

type XmppSendPresenceResponse struct {
	XXX_unrecognized []byte `json:"-"`
}

func (m *XmppSendPresenceResponse) Reset()         { *m = XmppSendPresenceResponse{} }
func (m *XmppSendPresenceResponse) String() string { return proto.CompactTextString(m) }
func (*XmppSendPresenceResponse) ProtoMessage()    {}

type XmppInviteRequest struct {
	Jid              *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`
	FromJid          *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *XmppInviteRequest) Reset()         { *m = XmppInviteRequest{} }
func (m *XmppInviteRequest) String() string { return proto.CompactTextString(m) }
func (*XmppInviteRequest) ProtoMessage()    {}

func (m *XmppInviteRequest) GetJid() string {
	if m != nil && m.Jid != nil {
		return *m.Jid
	}
	return ""
}

func (m *XmppInviteRequest) GetFromJid() string {
	if m != nil && m.FromJid != nil {
		return *m.FromJid
	}
	return ""
}

type XmppInviteResponse struct {
	XXX_unrecognized []byte `json:"-"`
}

func (m *XmppInviteResponse) Reset()         { *m = XmppInviteResponse{} }
func (m *XmppInviteResponse) String() string { return proto.CompactTextString(m) }
func (*XmppInviteResponse) ProtoMessage()    {}

func init() {
}


text:
syntax = "proto2";
option go_package = "xmpp";

package appengine;

message XmppServiceError {
  enum ErrorCode {
    UNSPECIFIED_ERROR = 1;
    INVALID_JID = 2;
    NO_BODY = 3;
    INVALID_XML = 4;
    INVALID_TYPE = 5;
    INVALID_SHOW = 6;
    EXCEEDED_MAX_SIZE = 7;
    APPID_ALIAS_REQUIRED = 8;
    NONDEFAULT_MODULE = 9;
  }
}

message PresenceRequest {
  required string jid = 1;
  optional string from_jid = 2;
}

message PresenceResponse {
  enum SHOW {
    NORMAL = 0;
    AWAY = 1;
    DO_NOT_DISTURB = 2;
    CHAT = 3;
    EXTENDED_AWAY = 4;
  }

  required bool is_available = 1;
  optional SHOW presence = 2;
  optional bool valid = 3;
}

message BulkPresenceRequest {
  repeated string jid = 1;
  optional string from_jid = 2;
}

message BulkPresenceResponse {
  repeated PresenceResponse presence_response = 1;
}

message XmppMessageRequest {
  repeated string jid = 1;
  required string body = 2;
  optional bool raw_xml = 3 [ default = false ];
  optional string type = 4 [ default = "chat" ];
  optional string from_jid = 5;
}

message XmppMessageResponse {
  enum XmppMessageStatus {
    NO_ERROR = 0;
    INVALID_JID = 1;
    OTHER_ERROR = 2;
  }

  repeated XmppMessageStatus status = 1;
}

message XmppSendPresenceRequest {
  required string jid = 1;
  optional string type = 2;
  optional string show = 3;
  optional string status = 4;
  optional string from_jid = 5;
}

message XmppSendPresenceResponse {
}

message XmppInviteRequest {
  required string jid = 1;
  optional string from_jid = 2;
}

message XmppInviteResponse {
}


text:
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

package delay

import (
	"bytes"
	"encoding/gob"
	"errors"
	"fmt"
	"net/http"
	"net/http/httptest"
	"reflect"
	"testing"

	"github.com/golang/protobuf/proto"
	"golang.org/x/net/context"

	"google.golang.org/appengine/internal"
	"google.golang.org/appengine/taskqueue"
)

type CustomType struct {
	N int
}

type CustomInterface interface {
	N() int
}

type CustomImpl int

func (c CustomImpl) N() int { return int(c) }

// CustomImpl needs to be registered with gob.
func init() {
	gob.Register(CustomImpl(0))
}

var (
	invalidFunc = Func("invalid", func() {})

	regFuncRuns = 0
	regFuncMsg  = ""
	regFunc     = Func("reg", func(c context.Context, arg string) {
		regFuncRuns++
		regFuncMsg = arg
	})

	custFuncTally = 0
	custFunc      = Func("cust", func(c context.Context, ct *CustomType, ci CustomInterface) {
		a, b := 2, 3
		if ct != nil {
			a = ct.N
		}
		if ci != nil {
			b = ci.N()
		}
		custFuncTally += a + b
	})

	anotherCustFunc = Func("cust2", func(c context.Context, n int, ct *CustomType, ci CustomInterface) {
	})

	varFuncMsg = ""
	varFunc    = Func("variadic", func(c context.Context, format string, args ...int) {
		// convert []int to []interface{} for fmt.Sprintf.
		as := make([]interface{}, len(args))
		for i, a := range args {
			as[i] = a
		}
		varFuncMsg = fmt.Sprintf(format, as...)
	})

	errFuncRuns = 0
	errFuncErr  = errors.New("error!")
	errFunc     = Func("err", func(c context.Context) error {
		errFuncRuns++
		if errFuncRuns == 1 {
			return nil
		}
		return errFuncErr
	})

	dupeWhich = 0
	dupe1Func = Func("dupe", func(c context.Context) {
		if dupeWhich == 0 {
			dupeWhich = 1
		}
	})
	dupe2Func = Func("dupe", func(c context.Context) {
		if dupeWhich == 0 {
			dupeWhich = 2
		}
	})
)

type fakeContext struct {
	ctx     context.Context
	logging [][]interface{}
}

func newFakeContext() *fakeContext {
	f := new(fakeContext)
	f.ctx = internal.WithCallOverride(context.Background(), f.call)
	f.ctx = internal.WithLogOverride(f.ctx, f.logf)
	return f
}

func (f *fakeContext) call(ctx context.Context, service, method string, in, out proto.Message) error {
	panic("should never be called")
}

var logLevels = map[int64]string{1: "INFO", 3: "ERROR"}

func (f *fakeContext) logf(level int64, format string, args ...interface{}) {
	f.logging = append(f.logging, append([]interface{}{logLevels[level], format}, args...))
}

func TestInvalidFunction(t *testing.T) {
	c := newFakeContext()

	if got, want := invalidFunc.Call(c.ctx), fmt.Errorf("delay: func is invalid: %s", errFirstArg); got.Error() != want.Error() {
		t.Errorf("Incorrect error: got %q, want %q", got, want)
	}
}

func TestVariadicFunctionArguments(t *testing.T) {
	// Check the argument type validation for variadic functions.

	c := newFakeContext()

	calls := 0
	taskqueueAdder = func(c context.Context, t *taskqueue.Task, _ string) (*taskqueue.Task, error) {
		calls++
		return t, nil
	}

	varFunc.Call(c.ctx, "hi")
	varFunc.Call(c.ctx, "%d", 12)
	varFunc.Call(c.ctx, "%d %d %d", 3, 1, 4)
	if calls != 3 {
		t.Errorf("Got %d calls to taskqueueAdder, want 3", calls)
	}

	if got, want := varFunc.Call(c.ctx, "%d %s", 12, "a string is bad"), errors.New("delay: argument 3 has wrong type: string is not assignable to int"); got.Error() != want.Error() {
		t.Errorf("Incorrect error: got %q, want %q", got, want)
	}
}

func TestBadArguments(t *testing.T) {
	// Try running regFunc with different sets of inappropriate arguments.

	c := newFakeContext()

	tests := []struct {
		args    []interface{} // all except context
		wantErr string
	}{
		{
			args:    nil,
			wantErr: "delay: too few arguments to func: 1 < 2",
		},
		{
			args:    []interface{}{"lala", 53},
			wantErr: "delay: too many arguments to func: 3 > 2",
		},
		{
			args:    []interface{}{53},
			wantErr: "delay: argument 1 has wrong type: int is not assignable to string",
		},
	}
	for i, tc := range tests {
		got := regFunc.Call(c.ctx, tc.args...)
		if got.Error() != tc.wantErr {
			t.Errorf("Call %v: got %q, want %q", i, got, tc.wantErr)
		}
	}
}

func TestRunningFunction(t *testing.T) {
	c := newFakeContext()

	// Fake out the adding of a task.
	var task *taskqueue.Task
	taskqueueAdder = func(_ context.Context, tk *taskqueue.Task, queue string) (*taskqueue.Task, error) {
		if queue != "" {
			t.Errorf(`Got queue %q, expected ""`, queue)
		}
		task = tk
		return tk, nil
	}

	regFuncRuns, regFuncMsg = 0, "" // reset state
	const msg = "Why, hello!"
	regFunc.Call(c.ctx, msg)

	// Simulate the Task Queue service.
	req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload))
	if err != nil {
		t.Fatalf("Failed making http.Request: %v", err)
	}
	rw := httptest.NewRecorder()
	runFunc(c.ctx, rw, req)

	if regFuncRuns != 1 {
		t.Errorf("regFuncRuns: got %d, want 1", regFuncRuns)
	}
	if regFuncMsg != msg {
		t.Errorf("regFuncMsg: got %q, want %q", regFuncMsg, msg)
	}
}

func TestCustomType(t *testing.T) {
	c := newFakeContext()

	// Fake out the adding of a task.
	var task *taskqueue.Task
	taskqueueAdder = func(_ context.Context, tk *taskqueue.Task, queue string) (*taskqueue.Task, error) {
		if queue != "" {
			t.Errorf(`Got queue %q, expected ""`, queue)
		}
		task = tk
		return tk, nil
	}

	custFuncTally = 0 // reset state
	custFunc.Call(c.ctx, &CustomType{N: 11}, CustomImpl(13))

	// Simulate the Task Queue service.
	req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload))
	if err != nil {
		t.Fatalf("Failed making http.Request: %v", err)
	}
	rw := httptest.NewRecorder()
	runFunc(c.ctx, rw, req)

	if custFuncTally != 24 {
		t.Errorf("custFuncTally = %d, want 24", custFuncTally)
	}

	// Try the same, but with nil values; one is a nil pointer (and thus a non-nil interface value),
	// and the other is a nil interface value.
	custFuncTally = 0 // reset state
	custFunc.Call(c.ctx, (*CustomType)(nil), nil)

	// Simulate the Task Queue service.
	req, err = http.NewRequest("POST", path, bytes.NewBuffer(task.Payload))
	if err != nil {
		t.Fatalf("Failed making http.Request: %v", err)
	}
	rw = httptest.NewRecorder()
	runFunc(c.ctx, rw, req)

	if custFuncTally != 5 {
		t.Errorf("custFuncTally = %d, want 5", custFuncTally)
	}
}

func TestRunningVariadic(t *testing.T) {
	c := newFakeContext()

	// Fake out the adding of a task.
	var task *taskqueue.Task
	taskqueueAdder = func(_ context.Context, tk *taskqueue.Task, queue string) (*taskqueue.Task, error) {
		if queue != "" {
			t.Errorf(`Got queue %q, expected ""`, queue)
		}
		task = tk
		return tk, nil
	}

	varFuncMsg = "" // reset state
	varFunc.Call(c.ctx, "Amiga %d has %d KB RAM", 500, 512)

	// Simulate the Task Queue service.
	req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload))
	if err != nil {
		t.Fatalf("Failed making http.Request: %v", err)
	}
	rw := httptest.NewRecorder()
	runFunc(c.ctx, rw, req)

	const expected = "Amiga 500 has 512 KB RAM"
	if varFuncMsg != expected {
		t.Errorf("varFuncMsg = %q, want %q", varFuncMsg, expected)
	}
}

func TestErrorFunction(t *testing.T) {
	c := newFakeContext()

	// Fake out the adding of a task.
	var task *taskqueue.Task
	taskqueueAdder = func(_ context.Context, tk *taskqueue.Task, queue string) (*taskqueue.Task, error) {
		if queue != "" {
			t.Errorf(`Got queue %q, expected ""`, queue)
		}
		task = tk
		return tk, nil
	}

	errFunc.Call(c.ctx)

	// Simulate the Task Queue service.
	// The first call should succeed; the second call should fail.
	{
		req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload))
		if err != nil {
			t.Fatalf("Failed making http.Request: %v", err)
		}
		rw := httptest.NewRecorder()
		runFunc(c.ctx, rw, req)
	}
	{
		req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload))
		if err != nil {
			t.Fatalf("Failed making http.Request: %v", err)
		}
		rw := httptest.NewRecorder()
		runFunc(c.ctx, rw, req)
		if rw.Code != http.StatusInternalServerError {
			t.Errorf("Got status code %d, want %d", rw.Code, http.StatusInternalServerError)
		}

		wantLogging := [][]interface{}{
			{"ERROR", "delay: func failed (will retry): %v", errFuncErr},
		}
		if !reflect.DeepEqual(c.logging, wantLogging) {
			t.Errorf("Incorrect logging: got %+v, want %+v", c.logging, wantLogging)
		}
	}
}

func TestDuplicateFunction(t *testing.T) {
	c := newFakeContext()

	// Fake out the adding of a task.
	var task *taskqueue.Task
	taskqueueAdder = func(_ context.Context, tk *taskqueue.Task, queue string) (*taskqueue.Task, error) {
		if queue != "" {
			t.Errorf(`Got queue %q, expected ""`, queue)
		}
		task = tk
		return tk, nil
	}

	if err := dupe1Func.Call(c.ctx); err == nil {
		t.Error("dupe1Func.Call did not return error")
	}
	if task != nil {
		t.Error("dupe1Func.Call posted a task")
	}
	if err := dupe2Func.Call(c.ctx); err != nil {
		t.Errorf("dupe2Func.Call error: %v", err)
	}
	if task == nil {
		t.Fatalf("dupe2Func.Call did not post a task")
	}

	// Simulate the Task Queue service.
	req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload))
	if err != nil {
		t.Fatalf("Failed making http.Request: %v", err)
	}
	rw := httptest.NewRecorder()
	runFunc(c.ctx, rw, req)

	if dupeWhich == 1 {
		t.Error("dupe2Func.Call used old registered function")
	} else if dupeWhich != 2 {
		t.Errorf("dupeWhich = %d; want 2", dupeWhich)
	}
}


text:
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

/*
Package delay provides a way to execute code outside the scope of a
user request by using the taskqueue API.

To declare a function that may be executed later, call Func
in a top-level assignment context, passing it an arbitrary string key
and a function whose first argument is of type context.Context.
	var laterFunc = delay.Func("key", myFunc)
It is also possible to use a function literal.
	var laterFunc = delay.Func("key", func(c context.Context, x string) {
		// ...
	})

To call a function, invoke its Call method.
	laterFunc.Call(c, "something")
A function may be called any number of times. If the function has any
return arguments, and the last one is of type error, the function may
return a non-nil error to signal that the function should be retried.

The arguments to functions may be of any type that is encodable by the gob
package. If an argument is of interface type, it is the client's responsibility
to register with the gob package whatever concrete type may be passed for that
argument; see http://golang.org/pkg/gob/#Register for details.

Any errors during initialization or execution of a function will be
logged to the application logs. Error logs that occur during initialization will
be associated with the request that invoked the Call method.

The state of a function invocation that has not yet successfully
executed is preserved by combining the file name in which it is declared
with the string key that was passed to the Func function. Updating an app
with pending function invocations is safe as long as the relevant
functions have the (filename, key) combination preserved.

The delay package uses the Task Queue API to create tasks that call the
reserved application path "/_ah/queue/go/delay".
This path must not be marked as "login: required" in app.yaml;
it must be marked as "login: admin" or have no access restriction.
*/
package delay // import "google.golang.org/appengine/delay"

import (
	"bytes"
	"encoding/gob"
	"errors"
	"fmt"
	"net/http"
	"reflect"
	"runtime"

	"golang.org/x/net/context"

	"google.golang.org/appengine"
	"google.golang.org/appengine/log"
	"google.golang.org/appengine/taskqueue"
)

// Function represents a function that may have a delayed invocation.
type Function struct {
	fv  reflect.Value // Kind() == reflect.Func
	key string
	err error // any error during initialization
}

const (
	// The HTTP path for invocations.
	path = "/_ah/queue/go/delay"
	// Use the default queue.
	queue = ""
)

var (
	// registry of all delayed functions
	funcs = make(map[string]*Function)

	// precomputed types
	contextType = reflect.TypeOf((*context.Context)(nil)).Elem()
	errorType   = reflect.TypeOf((*error)(nil)).Elem()

	// errors
	errFirstArg = errors.New("first argument must be context.Context")
)

// Func declares a new Function. The second argument must be a function with a
// first argument of type context.Context.
// This function must be called at program initialization time. That means it
// must be called in a global variable declaration or from an init function.
// This restriction is necessary because the instance that delays a function
// call may not be the one that executes it. Only the code executed at program
// initialization time is guaranteed to have been run by an instance before it
// receives a request.
func Func(key string, i interface{}) *Function {
	f := &Function{fv: reflect.ValueOf(i)}

	// Derive unique, somewhat stable key for this func.
	_, file, _, _ := runtime.Caller(1)
	f.key = file + ":" + key

	t := f.fv.Type()
	if t.Kind() != reflect.Func {
		f.err = errors.New("not a function")
		return f
	}
	if t.NumIn() == 0 || t.In(0) != contextType {
		f.err = errFirstArg
		return f
	}

	// Register the function's arguments with the gob package.
	// This is required because they are marshaled inside a []interface{}.
	// gob.Register only expects to be called during initialization;
	// that's fine because this function expects the same.
	for i := 0; i < t.NumIn(); i++ {
		// Only concrete types may be registered. If the argument has
		// interface type, the client is resposible for registering the
		// concrete types it will hold.
		if t.In(i).Kind() == reflect.Interface {
			continue
		}
		gob.Register(reflect.Zero(t.In(i)).Interface())
	}

	if old := funcs[f.key]; old != nil {
		old.err = fmt.Errorf("multiple functions registered for %s in %s", key, file)
	}
	funcs[f.key] = f
	return f
}

type invocation struct {
	Key  string
	Args []interface{}
}

// Call invokes a delayed function.
//   err := f.Call(c, ...)
// is equivalent to
//   t, _ := f.Task(...)
//   _, err := taskqueue.Add(c, t, "")
func (f *Function) Call(c context.Context, args ...interface{}) error {
	t, err := f.Task(args...)
	if err != nil {
		return err
	}
	_, err = taskqueueAdder(c, t, queue)
	return err
}

// Task creates a Task that will invoke the function.
// Its parameters may be tweaked before adding it to a queue.
// Users should not modify the Path or Payload fields of the returned Task.
func (f *Function) Task(args ...interface{}) (*taskqueue.Task, error) {
	if f.err != nil {
		return nil, fmt.Errorf("delay: func is invalid: %v", f.err)
	}

	nArgs := len(args) + 1 // +1 for the context.Context
	ft := f.fv.Type()
	minArgs := ft.NumIn()
	if ft.IsVariadic() {
		minArgs--
	}
	if nArgs < minArgs {
		return nil, fmt.Errorf("delay: too few arguments to func: %d < %d", nArgs, minArgs)
	}
	if !ft.IsVariadic() && nArgs > minArgs {
		return nil, fmt.Errorf("delay: too many arguments to func: %d > %d", nArgs, minArgs)
	}

	// Check arg types.
	for i := 1; i < nArgs; i++ {
		at := reflect.TypeOf(args[i-1])
		var dt reflect.Type
		if i < minArgs {
			// not a variadic arg
			dt = ft.In(i)
		} else {
			// a variadic arg
			dt = ft.In(minArgs).Elem()
		}
		// nil arguments won't have a type, so they need special handling.
		if at == nil {
			// nil interface
			switch dt.Kind() {
			case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
				continue // may be nil
			}
			return nil, fmt.Errorf("delay: argument %d has wrong type: %v is not nilable", i, dt)
		}
		switch at.Kind() {
		case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
			av := reflect.ValueOf(args[i-1])
			if av.IsNil() {
				// nil value in interface; not supported by gob, so we replace it
				// with a nil interface value
				args[i-1] = nil
			}
		}
		if !at.AssignableTo(dt) {
			return nil, fmt.Errorf("delay: argument %d has wrong type: %v is not assignable to %v", i, at, dt)
		}
	}

	inv := invocation{
		Key:  f.key,
		Args: args,
	}

	buf := new(bytes.Buffer)
	if err := gob.NewEncoder(buf).Encode(inv); err != nil {
		return nil, fmt.Errorf("delay: gob encoding failed: %v", err)
	}

	return &taskqueue.Task{
		Path:    path,
		Payload: buf.Bytes(),
	}, nil
}

var taskqueueAdder = taskqueue.Add // for testing

func init() {
	http.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) {
		runFunc(appengine.NewContext(req), w, req)
	})
}

func runFunc(c context.Context, w http.ResponseWriter, req *http.Request) {
	defer req.Body.Close()

	var inv invocation
	if err := gob.NewDecoder(req.Body).Decode(&inv); err != nil {
		log.Errorf(c, "delay: failed decoding task payload: %v", err)
		log.Warningf(c, "delay: dropping task")
		return
	}

	f := funcs[inv.Key]
	if f == nil {
		log.Errorf(c, "delay: no func with key %q found", inv.Key)
		log.Warningf(c, "delay: dropping task")
		return
	}

	ft := f.fv.Type()
	in := []reflect.Value{reflect.ValueOf(c)}
	for _, arg := range inv.Args {
		var v reflect.Value
		if arg != nil {
			v = reflect.ValueOf(arg)
		} else {
			// Task was passed a nil argument, so we must construct
			// the zero value for the argument here.
			n := len(in) // we're constructing the nth argument
			var at reflect.Type
			if !ft.IsVariadic() || n < ft.NumIn()-1 {
				at = ft.In(n)
			} else {
				at = ft.In(ft.NumIn() - 1).Elem()
			}
			v = reflect.Zero(at)
		}
		in = append(in, v)
	}
	out := f.fv.Call(in)

	if n := ft.NumOut(); n > 0 && ft.Out(n-1) == errorType {
		if errv := out[n-1]; !errv.IsNil() {
			log.Errorf(c, "delay: func failed (will retry): %v", errv.Interface())
			w.WriteHeader(http.StatusInternalServerError)
			return
		}
	}
}


text:
// Copyright 2013 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

package module

import (
	"reflect"
	"testing"

	"github.com/golang/protobuf/proto"

	"google.golang.org/appengine/internal/aetesting"
	pb "google.golang.org/appengine/internal/modules"
)

const version = "test-version"
const module = "test-module"
const instances = 3

func TestList(t *testing.T) {
	c := aetesting.FakeSingleContext(t, "modules", "GetModules", func(req *pb.GetModulesRequest, res *pb.GetModulesResponse) error {
		res.Module = []string{"default", "mod1"}
		return nil
	})
	got, err := List(c)
	if err != nil {
		t.Fatalf("List: %v", err)
	}
	want := []string{"default", "mod1"}
	if !reflect.DeepEqual(got, want) {
		t.Errorf("List = %v, want %v", got, want)
	}
}

func TestSetNumInstances(t *testing.T) {
	c := aetesting.FakeSingleContext(t, "modules", "SetNumInstances", func(req *pb.SetNumInstancesRequest, res *pb.SetNumInstancesResponse) error {
		if *req.Module != module {
			t.Errorf("Module = %v, want %v", req.Module, module)
		}
		if *req.Version != version {
			t.Errorf("Version = %v, want %v", req.Version, version)
		}
		if *req.Instances != instances {
			t.Errorf("Instances = %v, want %d", req.Instances, instances)
		}
		return nil
	})
	err := SetNumInstances(c, module, version, instances)
	if err != nil {
		t.Fatalf("SetNumInstances: %v", err)
	}
}

func TestVersions(t *testing.T) {
	c := aetesting.FakeSingleContext(t, "modules", "GetVersions", func(req *pb.GetVersionsRequest, res *pb.GetVersionsResponse) error {
		if *req.Module != module {
			t.Errorf("Module = %v, want %v", req.Module, module)
		}
		res.Version = []string{"v1", "v2", "v3"}
		return nil
	})
	got, err := Versions(c, module)
	if err != nil {
		t.Fatalf("Versions: %v", err)
	}
	want := []string{"v1", "v2", "v3"}
	if !reflect.DeepEqual(got, want) {
		t.Errorf("Versions = %v, want %v", got, want)
	}
}

func TestDefaultVersion(t *testing.T) {
	c := aetesting.FakeSingleContext(t, "modules", "GetDefaultVersion", func(req *pb.GetDefaultVersionRequest, res *pb.GetDefaultVersionResponse) error {
		if *req.Module != module {
			t.Errorf("Module = %v, want %v", req.Module, module)
		}
		res.Version = proto.String(version)
		return nil
	})
	got, err := DefaultVersion(c, module)
	if err != nil {
		t.Fatalf("DefaultVersion: %v", err)
	}
	if got != version {
		t.Errorf("Version = %v, want %v", got, version)
	}
}

func TestStart(t *testing.T) {
	c := aetesting.FakeSingleContext(t, "modules", "StartModule", func(req *pb.StartModuleRequest, res *pb.StartModuleResponse) error {
		if *req.Module != module {
			t.Errorf("Module = %v, want %v", req.Module, module)
		}
		if *req.Version != version {
			t.Errorf("Version = %v, want %v", req.Version, version)
		}
		return nil
	})

	err := Start(c, module, version)
	if err != nil {
		t.Fatalf("Start: %v", err)
	}
}

func TestStop(t *testing.T) {
	c := aetesting.FakeSingleContext(t, "modules", "StopModule", func(req *pb.StopModuleRequest, res *pb.StopModuleResponse) error {
		version := "test-version"
		module := "test-module"
		if *req.Module != module {
			t.Errorf("Module = %v, want %v", req.Module, module)
		}
		if *req.Version != version {
			t.Errorf("Version = %v, want %v", req.Version, version)
		}
		return nil
	})

	err := Stop(c, module, version)
	if err != nil {
		t.Fatalf("Stop: %v", err)
	}
}


text:
// Copyright 2013 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

/*
Package module provides functions for interacting with modules.

The appengine package contains functions that report the identity of the app,
including the module name.
*/
package module // import "google.golang.org/appengine/module"

import (
	"github.com/golang/protobuf/proto"
	"golang.org/x/net/context"

	"google.golang.org/appengine/internal"
	pb "google.golang.org/appengine/internal/modules"
)

// List returns the names of modules belonging to this application.
func List(c context.Context) ([]string, error) {
	req := &pb.GetModulesRequest{}
	res := &pb.GetModulesResponse{}
	err := internal.Call(c, "modules", "GetModules", req, res)
	return res.Module, err
}

// NumInstances returns the number of instances of the given module/version.
// If either argument is the empty string it means the default.
func NumInstances(c context.Context, module, version string) (int, error) {
	req := &pb.GetNumInstancesRequest{}
	if module != "" {
		req.Module = &module
	}
	if version != "" {
		req.Version = &version
	}
	res := &pb.GetNumInstancesResponse{}

	if err := internal.Call(c, "modules", "GetNumInstances", req, res); err != nil {
		return 0, err
	}
	return int(*res.Instances), nil
}

// SetNumInstances sets the number of instances of the given module.version to the
// specified value. If either module or version are the empty string it means the
// default.
func SetNumInstances(c context.Context, module, version string, instances int) error {
	req := &pb.SetNumInstancesRequest{}
	if module != "" {
		req.Module = &module
	}
	if version != "" {
		req.Version = &version
	}
	req.Instances = proto.Int64(int64(instances))
	res := &pb.SetNumInstancesResponse{}
	return internal.Call(c, "modules", "SetNumInstances", req, res)
}

// Versions returns the names of the versions that belong to the specified module.
// If module is the empty string, it means the default module.
func Versions(c context.Context, module string) ([]string, error) {
	req := &pb.GetVersionsRequest{}
	if module != "" {
		req.Module = &module
	}
	res := &pb.GetVersionsResponse{}
	err := internal.Call(c, "modules", "GetVersions", req, res)
	return res.GetVersion(), err
}

// DefaultVersion returns the default version of the specified module.
// If module is the empty string, it means the default module.
func DefaultVersion(c context.Context, module string) (string, error) {
	req := &pb.GetDefaultVersionRequest{}
	if module != "" {
		req.Module = &module
	}
	res := &pb.GetDefaultVersionResponse{}
	err := internal.Call(c, "modules", "GetDefaultVersion", req, res)
	return res.GetVersion(), err
}

// Start starts the specified version of the specified module.
// If either module or version are the empty string, it means the default.
func Start(c context.Context, module, version string) error {
	req := &pb.StartModuleRequest{}
	if module != "" {
		req.Module = &module
	}
	if version != "" {
		req.Version = &version
	}
	res := &pb.StartModuleResponse{}
	return internal.Call(c, "modules", "StartModule", req, res)
}

// Stop stops the specified version of the specified module.
// If either module or version are the empty string, it means the default.
func Stop(c context.Context, module, version string) error {
	req := &pb.StopModuleRequest{}
	if module != "" {
		req.Module = &module
	}
	if version != "" {
		req.Version = &version
	}
	res := &pb.StopModuleResponse{}
	return internal.Call(c, "modules", "StopModule", req, res)
}


text:
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

// Package user provides a client for App Engine's user authentication service.
package user // import "google.golang.org/appengine/user"

import (
	"strings"

	"github.com/golang/protobuf/proto"
	"golang.org/x/net/context"

	"google.golang.org/appengine/internal"
	pb "google.golang.org/appengine/internal/user"
)

// User represents a user of the application.
type User struct {
	Email      string
	AuthDomain string
	Admin      bool

	// ID is the unique permanent ID of the user.
	// It is populated if the Email is associated
	// with a Google account, or empty otherwise.
	ID string

	// ClientID is the ID of the pre-registered client so its identity can be verified.
	// See https://developers.google.com/console/help/#generatingoauth2 for more information.
	ClientID string

	FederatedIdentity string
	FederatedProvider string
}

// String returns a displayable name for the user.
func (u *User) String() string {
	if u.AuthDomain != "" && strings.HasSuffix(u.Email, "@"+u.AuthDomain) {
		return u.Email[:len(u.Email)-len("@"+u.AuthDomain)]
	}
	if u.FederatedIdentity != "" {
		return u.FederatedIdentity
	}
	return u.Email
}

// LoginURL returns a URL that, when visited, prompts the user to sign in,
// then redirects the user to the URL specified by dest.
func LoginURL(c context.Context, dest string) (string, error) {
	return LoginURLFederated(c, dest, "")
}

// LoginURLFederated is like LoginURL but accepts a user's OpenID identifier.
func LoginURLFederated(c context.Context, dest, identity string) (string, error) {
	req := &pb.CreateLoginURLRequest{
		DestinationUrl: proto.String(dest),
	}
	if identity != "" {
		req.FederatedIdentity = proto.String(identity)
	}
	res := &pb.CreateLoginURLResponse{}
	if err := internal.Call(c, "user", "CreateLoginURL", req, res); err != nil {
		return "", err
	}
	return *res.LoginUrl, nil
}

// LogoutURL returns a URL that, when visited, signs the user out,
// then redirects the user to the URL specified by dest.
func LogoutURL(c context.Context, dest string) (string, error) {
	req := &pb.CreateLogoutURLRequest{
		DestinationUrl: proto.String(dest),
	}
	res := &pb.CreateLogoutURLResponse{}
	if err := internal.Call(c, "user", "CreateLogoutURL", req, res); err != nil {
		return "", err
	}
	return *res.LogoutUrl, nil
}

func init() {
	internal.RegisterErrorCodeMap("user", pb.UserServiceError_ErrorCode_name)
}


text:
// Copyright 2012 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

package user

import (
	"golang.org/x/net/context"

	"google.golang.org/appengine/internal"
	pb "google.golang.org/appengine/internal/user"
)

// CurrentOAuth returns the user associated with the OAuth consumer making this
// request. If the OAuth consumer did not make a valid OAuth request, or the
// scopes is non-empty and the current user does not have at least one of the
// scopes, this method will return an error.
func CurrentOAuth(c context.Context, scopes ...string) (*User, error) {
	req := &pb.GetOAuthUserRequest{}
	if len(scopes) != 1 || scopes[0] != "" {
		// The signature for this function used to be CurrentOAuth(Context, string).
		// Ignore the singular "" scope to preserve existing behavior.
		req.Scopes = scopes
	}

	res := &pb.GetOAuthUserResponse{}

	err := internal.Call(c, "user", "GetOAuthUser", req, res)
	if err != nil {
		return nil, err
	}
	return &User{
		Email:      *res.Email,
		AuthDomain: *res.AuthDomain,
		Admin:      res.GetIsAdmin(),
		ID:         *res.UserId,
		ClientID:   res.GetClientId(),
	}, nil
}

// OAuthConsumerKey returns the OAuth consumer key provided with the current
// request. This method will return an error if the OAuth request was invalid.
func OAuthConsumerKey(c context.Context) (string, error) {
	req := &pb.CheckOAuthSignatureRequest{}
	res := &pb.CheckOAuthSignatureResponse{}

	err := internal.Call(c, "user", "CheckOAuthSignature", req, res)
	if err != nil {
		return "", err
	}
	return *res.OauthConsumerKey, err
}