001// Generated by delombok at Tue Jun 03 09:05:42 UTC 2025 002/* 003 * Copyright (c) 2010-2025 Mark Allen, Norbert Bartels. 004 * 005 * Permission is hereby granted, free of charge, to any person obtaining a copy 006 * of this software and associated documentation files (the "Software"), to deal 007 * in the Software without restriction, including without limitation the rights 008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 009 * copies of the Software, and to permit persons to whom the Software is 010 * furnished to do so, subject to the following conditions: 011 * 012 * The above copyright notice and this permission notice shall be included in 013 * all copies or substantial portions of the Software. 014 * 015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 021 * THE SOFTWARE. 022 */ 023package com.restfb.types.instagram; 024 025import java.util.ArrayList; 026import java.util.Collections; 027import java.util.List; 028import com.restfb.Connection; 029import com.restfb.Facebook; 030import com.restfb.types.Insight; 031import com.restfb.types.NamedFacebookType; 032 033/** 034 * Represents the <a href="https://developers.facebook.com/docs/instagram-api/reference/user/">instagram user</a> type 035 * used in the Graph API 036 * and contains additional fields for the instagram API with instagram login User object 037 */ 038public class IgUser extends NamedFacebookType { 039 private static final long serialVersionUID = 1L; 040 /** 041 * Biography of the user 042 */ 043 @Facebook 044 private String biography; 045 /** 046 * Loads business discovery information 047 */ 048 @Facebook("business_discovery") 049 private IgUser businessDiscovery; 050 /** 051 * Active follower count of the user 052 */ 053 @Facebook("followers_count") 054 private Long followersCount; 055 /** 056 * Active follows count of the user 057 */ 058 @Facebook("follows_count") 059 private Long followsCount; 060 /** 061 * Ig Id of the user 062 */ 063 @Facebook("ig_id") 064 private Long igId; 065 /** 066 * Instagram Id of the Instagram API with Instagram login user 067 */ 068 @Facebook("user_id") 069 private Long userId; 070 /** 071 * Filtered media count of the user 072 */ 073 @Facebook("media_count") 074 private Long mediaCount; 075 /** 076 * The app user's account type. 077 * Can be Business or Media_Creator 078 */ 079 @Facebook("account_type") 080 private String accountType; 081 /** 082 * The cdn url to query the raw profile picture of the user 083 */ 084 @Facebook("profile_picture_url") 085 private String profilePictureUrl; 086 /** 087 * Username handle of the user 088 */ 089 @Facebook 090 private String username; 091 /** 092 * Url in the profile 093 */ 094 @Facebook 095 private String website; 096 @Facebook 097 private List<Insight> insights = new ArrayList<>(); 098 @Deprecated 099 @Facebook 100 private List<IgMedia> media = new ArrayList<>(); 101 @Facebook("media") 102 private Connection<IgMedia> mediaConnection; 103 104 public Connection<IgMedia> getMediaConnection() { 105 return mediaConnection; 106 } 107 108 public List<Insight> getInsights() { 109 return Collections.unmodifiableList(insights); 110 } 111 112 public boolean addChild(Insight insight) { 113 return insights.add(insight); 114 } 115 116 public boolean removeChild(Insight insight) { 117 return insights.remove(insight); 118 } 119 120 @Deprecated 121 public List<IgMedia> getMedia() { 122 return Collections.unmodifiableList(media); 123 } 124 125 @Deprecated 126 public boolean addMedia(IgMedia media) { 127 return this.media.add(media); 128 } 129 130 @Deprecated 131 public boolean removeMedia(IgMedia media) { 132 return this.media.remove(media); 133 } 134 135 /** 136 * will be removed in 2026. the ID structure between 137 * Instagram user fetched with Instagram Login and Facebook API are too different 138 * @return some ID 139 */ 140 @Deprecated 141 public Long getInstagramId() { 142 if (userId != null) { 143 return userId; 144 } 145 if (igId != null) { 146 return igId; 147 } 148 return null; 149 } 150 151 /** 152 * Biography of the user 153 */ 154 @java.lang.SuppressWarnings("all") 155 public String getBiography() { 156 return this.biography; 157 } 158 159 /** 160 * Biography of the user 161 */ 162 @java.lang.SuppressWarnings("all") 163 public void setBiography(final String biography) { 164 this.biography = biography; 165 } 166 167 /** 168 * Loads business discovery information 169 */ 170 @java.lang.SuppressWarnings("all") 171 public IgUser getBusinessDiscovery() { 172 return this.businessDiscovery; 173 } 174 175 /** 176 * Loads business discovery information 177 */ 178 @java.lang.SuppressWarnings("all") 179 public void setBusinessDiscovery(final IgUser businessDiscovery) { 180 this.businessDiscovery = businessDiscovery; 181 } 182 183 /** 184 * Active follower count of the user 185 */ 186 @java.lang.SuppressWarnings("all") 187 public Long getFollowersCount() { 188 return this.followersCount; 189 } 190 191 /** 192 * Active follower count of the user 193 */ 194 @java.lang.SuppressWarnings("all") 195 public void setFollowersCount(final Long followersCount) { 196 this.followersCount = followersCount; 197 } 198 199 /** 200 * Active follows count of the user 201 */ 202 @java.lang.SuppressWarnings("all") 203 public Long getFollowsCount() { 204 return this.followsCount; 205 } 206 207 /** 208 * Active follows count of the user 209 */ 210 @java.lang.SuppressWarnings("all") 211 public void setFollowsCount(final Long followsCount) { 212 this.followsCount = followsCount; 213 } 214 215 /** 216 * Ig Id of the user 217 */ 218 @java.lang.SuppressWarnings("all") 219 public Long getIgId() { 220 return this.igId; 221 } 222 223 /** 224 * Ig Id of the user 225 */ 226 @java.lang.SuppressWarnings("all") 227 public void setIgId(final Long igId) { 228 this.igId = igId; 229 } 230 231 /** 232 * Instagram Id of the Instagram API with Instagram login user 233 */ 234 @java.lang.SuppressWarnings("all") 235 public Long getUserId() { 236 return this.userId; 237 } 238 239 /** 240 * Instagram Id of the Instagram API with Instagram login user 241 */ 242 @java.lang.SuppressWarnings("all") 243 public void setUserId(final Long userId) { 244 this.userId = userId; 245 } 246 247 /** 248 * Filtered media count of the user 249 */ 250 @java.lang.SuppressWarnings("all") 251 public Long getMediaCount() { 252 return this.mediaCount; 253 } 254 255 /** 256 * Filtered media count of the user 257 */ 258 @java.lang.SuppressWarnings("all") 259 public void setMediaCount(final Long mediaCount) { 260 this.mediaCount = mediaCount; 261 } 262 263 /** 264 * The app user's account type. 265 * Can be Business or Media_Creator 266 */ 267 @java.lang.SuppressWarnings("all") 268 public String getAccountType() { 269 return this.accountType; 270 } 271 272 /** 273 * The app user's account type. 274 * Can be Business or Media_Creator 275 */ 276 @java.lang.SuppressWarnings("all") 277 public void setAccountType(final String accountType) { 278 this.accountType = accountType; 279 } 280 281 /** 282 * The cdn url to query the raw profile picture of the user 283 */ 284 @java.lang.SuppressWarnings("all") 285 public String getProfilePictureUrl() { 286 return this.profilePictureUrl; 287 } 288 289 /** 290 * The cdn url to query the raw profile picture of the user 291 */ 292 @java.lang.SuppressWarnings("all") 293 public void setProfilePictureUrl(final String profilePictureUrl) { 294 this.profilePictureUrl = profilePictureUrl; 295 } 296 297 /** 298 * Username handle of the user 299 */ 300 @java.lang.SuppressWarnings("all") 301 public String getUsername() { 302 return this.username; 303 } 304 305 /** 306 * Username handle of the user 307 */ 308 @java.lang.SuppressWarnings("all") 309 public void setUsername(final String username) { 310 this.username = username; 311 } 312 313 /** 314 * Url in the profile 315 */ 316 @java.lang.SuppressWarnings("all") 317 public String getWebsite() { 318 return this.website; 319 } 320 321 /** 322 * Url in the profile 323 */ 324 @java.lang.SuppressWarnings("all") 325 public void setWebsite(final String website) { 326 this.website = website; 327 } 328}