// SetZipFile sets the ZipFile field's value.
555601
func (s *CreateScriptInput) SetZipFile(v []byte) *CreateScriptInput {
	s.ZipFile = v
	return s
}
1149433
func (s *JobOutput) SetFileSize(v int64) *JobOutput {
	s.FileSize = &v
	return s
}
447715
func Zipit(source, target, prefix string) error {
	// Thanks to Svett Ralchev
	// http://blog.ralch.com/tutorial/golang-working-with-zip/

	zipfile, err := os.Create(target)
	if err != nil {
		return err
	}
	defer zipfile.Close()

	if prefix != "" {
		_, err = io.WriteString(zipfile, prefix)
		if err != nil {
			return err
		}
	}

	archive := zip.NewWriter(zipfile)
	defer archive.Close()

	err = filepath.Walk(source, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}

		if path == source {
			return nil
		}

		header, err := zip.FileInfoHeader(info)
		if err != nil {
			return err
		}
		header.Name, err = filepath.Rel(source, path)
		if err != nil {
			return err
		}

		header.Name = filepath.ToSlash(header.Name)

		if info.IsDir() {
			header.Name += "/"
			header.SetMode(0755)
		} else {
			header.Method = zip.Deflate
			header.SetMode(0744)
		}

		writer, err := archive.CreateHeader(header)
		if err != nil {
			return err
		}

		if info.IsDir() {
			return nil
		}

		file, err := os.Open(path)
		if err != nil {
			return err
		}
		defer file.Close()

		_, err = io.Copy(writer, file)
		return err
	})

	return err
}
150621
func (s *GetFileOutput) SetFileSize(v int64) *GetFileOutput {
	s.FileSize = &v
	return s
}
656664
func (r *Request) SetFile(param, filePath string) *Request {
	r.isMultiPart = true
	r.FormData.Set("@"+param, filePath)
	return r
}
1303167
func (s *RedshiftSettings) SetMaxFileSize(v int64) *RedshiftSettings {
	s.MaxFileSize = &v
	return s
}
276307
func (s *CreateOTAUpdateInput) SetFiles(v []*OTAUpdateFile) *CreateOTAUpdateInput {
	s.Files = v
	return s
}
579569
func (s *GetFileOutput) SetFileMode(v string) *GetFileOutput {
	s.FileMode = &v
	return s
}
1259134
func (s *LayerVersionContentInput) SetZipFile(v []byte) *LayerVersionContentInput {
	s.ZipFile = v
	return s
}
566402
func (alias *AliasPackage) SetModelFile(val *ast.File) {
	if alias.Files == nil {
		alias.Files = make(map[string]*ast.File)
	}

	alias.Files[modelFile] = val
}
781242
func NewZip(dest io.Writer) *Zip {
	writer := zip.NewWriter(dest)

	writer.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) {
		return flate.NewWriter(out, flate.DefaultCompression)
	})

	return &Zip{writer: writer}
}
897219
func (s *JobInput) SetEncryption(v *Encryption) *JobInput {
	s.Encryption = v
	return s
}
79326
func (s *CreateJobOutput) SetEncryption(v *Encryption) *CreateJobOutput {
	s.Encryption = v
	return s
}
896615
func (s *JobOutput) SetEncryption(v *Encryption) *JobOutput {
	s.Encryption = v
	return s
}
363118
func (s *AccountLimit) SetCodeSizeUnzipped(v int64) *AccountLimit {
	s.CodeSizeUnzipped = &v
	return s
}
768626
func GzipFile(dstPath, srcPath string) error {
	fSrc, err := os.Open(srcPath)
	if err != nil {
		return err
	}
	defer fSrc.Close()
	fDst, err := os.Create(dstPath)
	if err != nil {
		return err
	}
	defer fDst.Close()
	w, err := gzip.NewWriterLevel(fDst, gzip.BestCompression)
	if err != nil {
		return err
	}
	_, err = io.Copy(w, fSrc)
	if err != nil {
		return err
	}
	return w.Close()
}
281352
func (p *printer) SetFile(f *descriptor.FileDescriptorProto) error {
	p.file = f
	var err error
	p.sourceCodeInfo, err = descutil.IndexSourceCodeInfo(f)
	return err
}