Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
Use int64 type for long integers where neccessary (#1)
Browse files Browse the repository at this point in the history
Closes #149
  • Loading branch information
cd2ee909 authored and dgrr committed Sep 16, 2018
1 parent 2e09744 commit cdbc11e
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion account.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type Account struct {
SocialContext string `json:"social_context,omitempty"`
SearchSocialContext string `json:"search_social_context,omitempty"`
MutualFollowersCount float64 `json:"mutual_followers_count"`
LatestReelMedia int `json:"latest_reel_media,omitempty"`
LatestReelMedia int64 `json:"latest_reel_media,omitempty"`
CityID int64 `json:"city_id"`
CityName string `json:"city_name"`
AddressStreet string `json:"address_street"`
Expand Down
12 changes: 6 additions & 6 deletions activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ type FollowingActivity struct {
Type string `json:"type"`
ID string `json:"id"`
} `json:"links"`
ProfileID int `json:"profile_id"`
ProfileID int64 `json:"profile_id"`
ProfileImage string `json:"profile_image"`
SecondProfileID int `json:"second_profile_id"`
SecondProfileID int64 `json:"second_profile_id"`
SecondProfileImage string `json:"second_profile_image"`
ProfileImageDestination string `json:"profile_image_destination"`
Media []struct {
ID string `json:"id"`
Image string `json:"image"`
} `json:"media"`
Timestamp int `json:"timestamp"`
Timestamp int64 `json:"timestamp"`
Tuuid string `json:"tuuid"`
} `json:"args"`
Counts struct {
Expand Down Expand Up @@ -134,19 +134,19 @@ type MineActivity struct {
OutgoingRequest bool `json:"outgoing_request"`
} `json:"inline_follow"`
Actions []string `json:"actions"`
ProfileID int `json:"profile_id"`
ProfileID int64 `json:"profile_id"`
ProfileImage string `json:"profile_image"`
Timestamp float64 `json:"timestamp"`
Tuuid string `json:"tuuid"`
Clicked bool `json:"clicked"`
ProfileName string `json:"profile_name"`
LatestReelMedia int `json:"latest_reel_media"`
LatestReelMedia int64 `json:"latest_reel_media"`
} `json:"args"`
Counts struct {
} `json:"counts"`
Pk string `json:"pk"`
} `json:"old_stories"`
ContinuationToken int `json:"continuation_token"`
ContinuationToken int64 `json:"continuation_token"`
Subscription interface{} `json:"subscription"`
NextID int64 `json:"next_max_id"`
Status string `json:"status"`
Expand Down
6 changes: 3 additions & 3 deletions comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Comments struct {
err error

Items []Comment `json:"comments"`
CommentCount int `json:"comment_count"`
CommentCount int64 `json:"comment_count"`
Caption Caption `json:"caption"`
CaptionIsEdited bool `json:"caption_is_edited"`
HasMoreComments bool `json:"has_more_comments"`
Expand Down Expand Up @@ -298,8 +298,8 @@ type Comment struct {
CommentIndex int `json:"comment_index"`
CommentLikeCount int `json:"comment_like_count"`
ContentType string `json:"content_type"`
CreatedAt int `json:"created_at"`
CreatedAtUtc int `json:"created_at_utc"`
CreatedAt int64 `json:"created_at"`
CreatedAtUtc int64 `json:"created_at_utc"`
DidReportAsSpam bool `json:"did_report_as_spam"`
HasLikedComment bool `json:"has_liked_comment"`
InlineComposerDisplayCondition string `json:"inline_composer_display_condition"`
Expand Down
4 changes: 2 additions & 2 deletions inbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ type Inbox struct {
UnseenCountTs int64 `json:"unseen_count_ts"`
BlendedInboxEnabled bool `json:"blended_inbox_enabled"`
// this fields are copied from response
SeqID int `json:"seq_id"`
SeqID int64 `json:"seq_id"`
PendingRequestsTotal int `json:"pending_requests_total"`
SnapshotAtMs int64 `json:"snapshot_at_ms"`
}

type inboxResp struct {
Inbox Inbox `json:"inbox"`
SeqID int `json:"seq_id"`
SeqID int64 `json:"seq_id"`
PendingRequestsTotal int `json:"pending_requests_total"`
SnapshotAtMs int64 `json:"snapshot_at_ms"`
Status string `json:"status"`
Expand Down
6 changes: 3 additions & 3 deletions media.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type Item struct {
Images Images `json:"image_versions2,omitempty"`
OriginalWidth int `json:"original_width,omitempty"`
OriginalHeight int `json:"original_height,omitempty"`
ImportedTakenAt int `json:"imported_taken_at,omitempty"`
ImportedTakenAt int64 `json:"imported_taken_at,omitempty"`
Location Location `json:"location,omitempty"`
Lat float64 `json:"lat,omitempty"`
Lng float64 `json:"lng,omitempty"`
Expand All @@ -93,7 +93,7 @@ type Item struct {
StoryProductItems []interface{} `json:"story_product_items"`
SupportsReelReactions bool `json:"supports_reel_reactions"`
ShowOneTapFbShareTooltip bool `json:"show_one_tap_fb_share_tooltip"`
HasSharedToFb int `json:"has_shared_to_fb"`
HasSharedToFb int64 `json:"has_shared_to_fb"`
Mentions []Mentions
}

Expand Down Expand Up @@ -527,7 +527,7 @@ type StoryMedia struct {
err error

Pk interface{} `json:"id"`
LatestReelMedia int `json:"latest_reel_media"`
LatestReelMedia int64 `json:"latest_reel_media"`
ExpiringAt float64 `json:"expiring_at"`
HaveBeenSeen float64 `json:"seen"`
CanReply bool `json:"can_reply"`
Expand Down
4 changes: 2 additions & 2 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type SearchResult struct {
HasMore bool `json:"has_more"`
RankToken string `json:"rank_token"`
Status string `json:"status"`
NumResults int `json:"num_results"`
NumResults int64 `json:"num_results"`

// User search results
Users []User `json:"users"`
Expand Down Expand Up @@ -197,7 +197,7 @@ func (search *Search) FeedTags(tag string) (*FeedTag, error) {
type FeedTag struct {
RankedItems []Item `json:"ranked_items"`
Images []Item `json:"items"`
NumResults int `json:"num_results"`
NumResults int64 `json:"num_results"`
NextID string `json:"next_max_id"`
MoreAvailable bool `json:"more_available"`
AutoLoadMoreEnabled bool `json:"auto_load_more_enabled"`
Expand Down
30 changes: 15 additions & 15 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ func (e Error400) Error() string {

// Nametag is part of the account information.
type Nametag struct {
Mode int `json:"mode"`
Gradient int `json:"gradient"`
Mode int64 `json:"mode"`
Gradient int64 `json:"gradient"`
Emoji string `json:"emoji"`
SelfieSticker int `json:"selfie_sticker"`
SelfieSticker int64 `json:"selfie_sticker"`
}

type friendResp struct {
Expand All @@ -78,7 +78,7 @@ type friendResp struct {

// Location stores media location information.
type Location struct {
Pk int `json:"pk"`
Pk int64 `json:"pk"`
Name string `json:"name"`
Address string `json:"address"`
City string `json:"city"`
Expand Down Expand Up @@ -177,11 +177,11 @@ type Tag struct {
// Caption is media caption
type Caption struct {
ID int64 `json:"pk"`
UserID int `json:"user_id"`
UserID int64 `json:"user_id"`
Text string `json:"text"`
Type int `json:"type"`
CreatedAt int `json:"created_at"`
CreatedAtUtc int `json:"created_at_utc"`
CreatedAt int64 `json:"created_at"`
CreatedAtUtc int64 `json:"created_at_utc"`
ContentType string `json:"content_type"`
Status string `json:"status"`
BitFlags int `json:"bit_flags"`
Expand All @@ -195,7 +195,7 @@ type Caption struct {
type Mentions struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Z int `json:"z"`
Z int64 `json:"z"`
Width float64 `json:"width"`
Height float64 `json:"height"`
Rotation float64 `json:"rotation"`
Expand Down Expand Up @@ -257,9 +257,9 @@ type LiveItems struct {
ID string `json:"pk"`
User User `json:"user"`
Broadcasts []Broadcast `json:"broadcasts"`
LastSeenBroadcastTs int `json:"last_seen_broadcast_ts"`
RankedPosition int `json:"ranked_position"`
SeenRankedPosition int `json:"seen_ranked_position"`
LastSeenBroadcastTs int64 `json:"last_seen_broadcast_ts"`
RankedPosition int64 `json:"ranked_position"`
SeenRankedPosition int64 `json:"seen_ranked_position"`
Muted bool `json:"muted"`
CanReply bool `json:"can_reply"`
CanReshare bool `json:"can_reshare"`
Expand All @@ -270,13 +270,13 @@ type Broadcast struct {
ID int64 `json:"id"`
BroadcastStatus string `json:"broadcast_status"`
DashManifest string `json:"dash_manifest"`
ExpireAt int `json:"expire_at"`
ExpireAt int64 `json:"expire_at"`
EncodingTag string `json:"encoding_tag"`
InternalOnly bool `json:"internal_only"`
NumberOfQualities int `json:"number_of_qualities"`
CoverFrameURL string `json:"cover_frame_url"`
BroadcastOwner User `json:"broadcast_owner"`
PublishedTime int `json:"published_time"`
PublishedTime int64 `json:"published_time"`
MediaID string `json:"media_id"`
BroadcastMessage string `json:"broadcast_message"`
OrganicTrackingToken string `json:"organic_tracking_token"`
Expand All @@ -289,7 +289,7 @@ type BlockedUser struct {
Username string `json:"username"`
FullName string `json:"full_name"`
ProfilePicURL string `json:"profile_pic_url"`
BlockAt int `json:"block_at"`
BlockAt int64 `json:"block_at"`
}

// Unblock unblocks blocked user.
Expand All @@ -315,7 +315,7 @@ type InboxItemMedia struct {
ItemID string `json:"item_id"`
ItemType string `json:"item_type"`
RavenMedia struct {
MediaType int `json:"media_type"`
MediaType int64 `json:"media_type"`
} `json:"raven_media"`
ReplyChainCount int `json:"reply_chain_count"`
SeenUserIds []interface{} `json:"seen_user_ids"`
Expand Down
52 changes: 26 additions & 26 deletions users.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,31 @@ type userResp struct {
type User struct {
inst *Instagram

ID int64 `json:"pk"`
Username string `json:"username"`
FullName string `json:"full_name"`
Biography string `json:"biography"`
ProfilePicURL string `json:"profile_pic_url"`
Email string `json:"email"`
PhoneNumber string `json:"phone_number"`
IsBusiness bool `json:"is_business"`
Gender int `json:"gender"`
ProfilePicID string `json:"profile_pic_id"`
HasAnonymousProfilePicture bool `json:"has_anonymous_profile_picture"`
IsPrivate bool `json:"is_private"`
IsUnpublished bool `json:"is_unpublished"`
AllowedCommenterType string `json:"allowed_commenter_type"`
IsVerified bool `json:"is_verified"`
MediaCount int `json:"media_count"`
FollowerCount int `json:"follower_count"`
FollowingCount int `json:"following_count"`
FollowingTagCount int `json:"following_tag_count"`
MutualFollowersID []int `json:"profile_context_mutual_follow_ids"`
ProfileContext string `json:"profile_context"`
GeoMediaCount int `json:"geo_media_count"`
ExternalURL string `json:"external_url"`
HasBiographyTranslation bool `json:"has_biography_translation"`
ExternalLynxURL string `json:"external_lynx_url"`
ID int64 `json:"pk"`
Username string `json:"username"`
FullName string `json:"full_name"`
Biography string `json:"biography"`
ProfilePicURL string `json:"profile_pic_url"`
Email string `json:"email"`
PhoneNumber string `json:"phone_number"`
IsBusiness bool `json:"is_business"`
Gender int `json:"gender"`
ProfilePicID string `json:"profile_pic_id"`
HasAnonymousProfilePicture bool `json:"has_anonymous_profile_picture"`
IsPrivate bool `json:"is_private"`
IsUnpublished bool `json:"is_unpublished"`
AllowedCommenterType string `json:"allowed_commenter_type"`
IsVerified bool `json:"is_verified"`
MediaCount int `json:"media_count"`
FollowerCount int `json:"follower_count"`
FollowingCount int `json:"following_count"`
FollowingTagCount int `json:"following_tag_count"`
MutualFollowersID []int64 `json:"profile_context_mutual_follow_ids"`
ProfileContext string `json:"profile_context"`
GeoMediaCount int `json:"geo_media_count"`
ExternalURL string `json:"external_url"`
HasBiographyTranslation bool `json:"has_biography_translation"`
ExternalLynxURL string `json:"external_lynx_url"`
BiographyWithEntities struct {
RawText string `json:"raw_text"`
Entities []interface{} `json:"entities"`
Expand Down Expand Up @@ -159,7 +159,7 @@ type User struct {
SocialContext string `json:"social_context,omitempty"`
SearchSocialContext string `json:"search_social_context,omitempty"`
MutualFollowersCount float64 `json:"mutual_followers_count"`
LatestReelMedia int `json:"latest_reel_media,omitempty"`
LatestReelMedia int64 `json:"latest_reel_media,omitempty"`
IsCallToActionEnabled bool `json:"is_call_to_action_enabled"`
FbPageCallToActionID string `json:"fb_page_call_to_action_id"`
Zip string `json:"zip"`
Expand Down

0 comments on commit cdbc11e

Please sign in to comment.