1package azblob
2
3import (
4	"time"
5)
6
7// ModifiedAccessConditions identifies standard HTTP access conditions which you optionally set.
8type ModifiedAccessConditions struct {
9	IfModifiedSince   time.Time
10	IfUnmodifiedSince time.Time
11	IfMatch           ETag
12	IfNoneMatch       ETag
13}
14
15// pointers is for internal infrastructure. It returns the fields as pointers.
16func (ac ModifiedAccessConditions) pointers() (ims *time.Time, ius *time.Time, ime *ETag, inme *ETag) {
17	if !ac.IfModifiedSince.IsZero() {
18		ims = &ac.IfModifiedSince
19	}
20	if !ac.IfUnmodifiedSince.IsZero() {
21		ius = &ac.IfUnmodifiedSince
22	}
23	if ac.IfMatch != ETagNone {
24		ime = &ac.IfMatch
25	}
26	if ac.IfNoneMatch != ETagNone {
27		inme = &ac.IfNoneMatch
28	}
29	return
30}
31
32// ContainerAccessConditions identifies container-specific access conditions which you optionally set.
33type ContainerAccessConditions struct {
34	ModifiedAccessConditions
35	LeaseAccessConditions
36}
37
38// BlobAccessConditions identifies blob-specific access conditions which you optionally set.
39type BlobAccessConditions struct {
40	ModifiedAccessConditions
41	LeaseAccessConditions
42}
43
44// LeaseAccessConditions identifies lease access conditions for a container or blob which you optionally set.
45type LeaseAccessConditions struct {
46	LeaseID string
47}
48
49// pointers is for internal infrastructure. It returns the fields as pointers.
50func (ac LeaseAccessConditions) pointers() (leaseID *string) {
51	if ac.LeaseID != "" {
52		leaseID = &ac.LeaseID
53	}
54	return
55}
56
57/*
58// getInt32 is for internal infrastructure. It is used with access condition values where
59// 0 (the default setting) is meaningful. The library interprets 0 as do not send the header
60// and the privately-storage field in the access condition object is stored as +1 higher than desired.
61// THis method returns true, if the value is > 0 (explicitly set) and the stored value - 1 (the set desired value).
62func getInt32(value int32) (bool, int32) {
63	return value > 0, value - 1
64}
65*/
66